Documentation
¶
Overview ¶
Package provider declares every provider value the CLI sends the API in a config, checkout or trigger source, and, for the integrations onboarding can connect, how to recognise one from a git remote.
Adding a provider means adding one entry to the registry below. The provider table in the triggers help topic is prose and is kept up to date by hand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Provider ¶
type Provider struct {
// Name is the value the API uses in provider fields and filters.
Name string
// Roles are the source fields Name may be sent in.
Roles Role
// Repo is how the API identifies a repository of this provider.
Repo RepoKey
// RepoIDExample is a sample external repository id in the provider's shape,
// shown as a prompt placeholder. Set for every provider with a repository.
RepoIDExample string
// Short names the integration in progress output, e.g. "GitHub App" in
// "Waiting for GitHub App installation".
Short string
// Install is the subject of the install prompt, e.g. "the CircleCI GitHub
// App" in "Install the CircleCI GitHub App to connect your repository".
Install string
// Hosts are the git remote hosts whose repositories belong to this
// integration. A host matches when it equals one of these or is a subdomain
// of it, so enterprise and regional hosts resolve without new entries. A
// provider with no hosts is never resolved from a remote.
Hosts []string
// InstalledPath is the app page an install returns the browser to, relative to
// the app URL. It confirms the install and points the user back at their
// terminal, so it names the integration the user just installed.
InstalledPath string
}
Provider describes a value the API accepts in a source's provider field.
func ForHost ¶
ForHost returns the integration that owns repositories on host, and whether one was found. Matching is case-insensitive and ignores a port.
func Lookup ¶ added in v1.16.0
Lookup returns the provider named name that may be sent in the source field r, and whether there is one.
func (Provider) FullNameIsEnough ¶ added in v1.16.0
FullNameIsEnough reports whether a source of p may name its repository by owner/name alone, with no external id.
func (Provider) HasRepo ¶ added in v1.16.0
HasRepo reports whether a source of p names a repository at all.
func (Provider) NeedsFullName ¶ added in v1.16.0
NeedsFullName reports whether a source of p must name the repository's owner/name as well as its id.
func (Provider) NeedsRepoID ¶ added in v1.16.0
NeedsRepoID reports whether a source of p must name a repository external id.
type RepoKey ¶ added in v1.16.0
type RepoKey uint8
RepoKey is how the API identifies a provider's repository.
const ( // NoRepo providers have no repository. NoRepo RepoKey = iota // RepoID providers identify a repository by its external id alone. RepoID // RepoIDAndFullName providers need the owner/name as well as the external id. // Origin exposes no lookup by id, so the full name is what resolves the // repository at all; the API rejects a write without it and rejects a pair that // names two different repositories. RepoIDAndFullName // RepoIDOrFullName providers identify a repository by its external id or by // its owner/name; either alone is enough. When both are sent they must name the // same repository. RepoIDOrFullName )