provider

package
v1.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func List added in v1.16.0

func List(r Role, filters ...func(Provider) bool) string

List is Names joined for help text and error suggestions, e.g. "github_app, github_server, origin".

func Names added in v1.16.0

func Names(r Role, filters ...func(Provider) bool) []string

Names returns, in registry order, the names of the providers that may be sent in the source field r and satisfy every filter.

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
	// TerminalConnect marks a self-hosted integration onboarding connects in the
	// terminal, from values the user supplies, rather than through a browser
	// install. It has no Hosts: a self-hosted instance can be on any.
	TerminalConnect bool
}

Provider describes a value the API accepts in a source's provider field.

func ForHost

func ForHost(host string) (Provider, bool)

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

func Lookup(name string, r Role) (Provider, bool)

Lookup returns the provider named name that may be sent in the source field r, and whether there is one.

func (Provider) ConnectsInTerminal added in v1.19.0

func (p Provider) ConnectsInTerminal() bool

ConnectsInTerminal reports whether onboarding connects p in the terminal, from values the user supplies.

func (Provider) FullNameIsEnough added in v1.16.0

func (p Provider) FullNameIsEnough() bool

FullNameIsEnough reports whether a source of p may name its repository by owner/name alone, with no external id.

func (Provider) Has added in v1.16.0

func (p Provider) Has(r Role) bool

Has reports whether p may be sent in the source field r.

func (Provider) HasRepo added in v1.16.0

func (p Provider) HasRepo() bool

HasRepo reports whether a source of p names a repository at all.

func (Provider) NeedsFullName added in v1.16.0

func (p Provider) NeedsFullName() bool

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

func (p Provider) NeedsRepoID() bool

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
)

type Role added in v1.16.0

type Role uint8

Role is a source field a provider may be sent in. A provider can hold several.

const (
	// ConfigSource providers can supply a pipeline definition's config.
	ConfigSource Role = 1 << iota
	// CheckoutSource providers can supply the code a pipeline checks out.
	CheckoutSource
	// TriggerSource providers can be the event source of a trigger.
	TriggerSource
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL