Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions cmd/src/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
"time"

"github.com/sourcegraph/sourcegraph/lib/errors"

Expand Down Expand Up @@ -51,53 +50,17 @@ Use "src repos [command] -h" for more information about a command.

const repositoryFragment = `
fragment RepositoryFields on Repository {
id
name
url
description
language
createdAt
updatedAt
externalRepository {
id
serviceType
serviceID
}
defaultBranch {
name
displayName
}
viewerCanAdminister
keyValuePairs {
key
value
}
}
`

type Repository struct {
ID string `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
Description string `json:"description"`
Language string `json:"language"`
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"`
Name string `json:"name"`
DefaultBranch GitRef `json:"defaultBranch"`
}

type GitRef struct {
Expand Down
Loading