mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 17:51:57 +00:00
25 lines
577 B
Go
25 lines
577 B
Go
package schema
|
|
|
|
// DefaultGitHubURL is the default GitHub instance that configuration points to.
|
|
const DefaultGitHubURL = "https://github.com/"
|
|
|
|
// GetURL retrieves the configured GitHub URL or a default if one is not set.
|
|
func (p *GitHubAuthProvider) GetURL() string {
|
|
if p != nil && p.Url != "" {
|
|
return p.Url
|
|
}
|
|
return DefaultGitHubURL
|
|
}
|
|
|
|
func (c *GitHubConnection) SetRepos(all bool, repos []string) error {
|
|
if all {
|
|
c.RepositoryQuery = []string{"affiliated"}
|
|
c.Repos = nil
|
|
return nil
|
|
} else {
|
|
c.RepositoryQuery = []string{}
|
|
}
|
|
c.Repos = repos
|
|
return nil
|
|
}
|