diff --git a/cmd/src/repos.go b/cmd/src/repos.go index c1347f5889..b839f6d1e8 100644 --- a/cmd/src/repos.go +++ b/cmd/src/repos.go @@ -4,6 +4,7 @@ import ( "context" "flag" "fmt" + "time" "github.com/sourcegraph/sourcegraph/lib/errors" @@ -50,17 +51,51 @@ Use "src repos [command] -h" for more information about a command. const repositoryFragment = ` fragment RepositoryFields on Repository { + id name + url + description + createdAt + updatedAt + externalRepository { + id + serviceType + serviceID + } defaultBranch { name displayName } + viewerCanAdminister + keyValuePairs { + key + value + } } ` type Repository struct { - Name string `json:"name"` - DefaultBranch GitRef `json:"defaultBranch"` + ID string `json:"id"` + Name string `json:"name"` + URL string `json:"url"` + Description string `json:"description"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` + ExternalRepository ExternalRepository `json:"externalRepository"` + DefaultBranch GitRef `json:"defaultBranch"` + ViewerCanAdminister bool `json:"viewerCanAdminister"` + KeyValuePairs []KeyValuePair `json:"keyValuePairs"` +} + +type KeyValuePair struct { + Key string `json:"key"` + Value *string `json:"value"` +} + +type ExternalRepository struct { + ID string `json:"id"` + ServiceType string `json:"serviceType"` + ServiceID string `json:"serviceID"` } type GitRef struct {