Documentation
¶
Overview ¶
Package providers contains general utilities for interacting with providers.
Index ¶
- type ProviderBuilder
- func (pb *ProviderBuilder) GetGit() (*gitclient.Git, error)
- func (pb *ProviderBuilder) GetGitHub(ctx context.Context) (*ghclient.RestClient, error)
- func (pb *ProviderBuilder) GetHTTP(ctx context.Context) (provinfv1.REST, error)
- func (pb *ProviderBuilder) GetName() string
- func (pb *ProviderBuilder) GetRepoLister(ctx context.Context) (provinfv1.RepoLister, error)
- func (pb *ProviderBuilder) GetToken() string
- func (pb *ProviderBuilder) Implements(impl db.ProviderType) bool
- type ProviderBuilderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderBuilder ¶
type ProviderBuilder struct {
// contains filtered or unexported fields
}
ProviderBuilder is a utility struct which allows for the creation of provider clients.
func GetProviderBuilder ¶
func GetProviderBuilder( ctx context.Context, prov db.Provider, projectID uuid.UUID, store db.Store, crypteng *crypto.Engine, opts ...ProviderBuilderOption, ) (*ProviderBuilder, error)
GetProviderBuilder is a utility function which allows for the creation of a provider factory.
func NewProviderBuilder ¶
func NewProviderBuilder( p *db.Provider, tokenInf db.ProviderAccessToken, tok string, opts ...ProviderBuilderOption, ) *ProviderBuilder
NewProviderBuilder creates a new provider builder.
func (*ProviderBuilder) GetGit ¶
func (pb *ProviderBuilder) GetGit() (*gitclient.Git, error)
GetGit returns a git client for the provider.
func (*ProviderBuilder) GetGitHub ¶
func (pb *ProviderBuilder) GetGitHub(ctx context.Context) (*ghclient.RestClient, error)
GetGitHub returns a github client for the provider.
func (*ProviderBuilder) GetName ¶
func (pb *ProviderBuilder) GetName() string
GetName returns the name of the provider instance as defined in the database.
func (*ProviderBuilder) GetRepoLister ¶
func (pb *ProviderBuilder) GetRepoLister(ctx context.Context) (provinfv1.RepoLister, error)
GetRepoLister returns a repo lister for the provider.
func (*ProviderBuilder) GetToken ¶
func (pb *ProviderBuilder) GetToken() string
GetToken returns the token for the provider.
func (*ProviderBuilder) Implements ¶
func (pb *ProviderBuilder) Implements(impl db.ProviderType) bool
Implements returns true if the provider implements the given type.
type ProviderBuilderOption ¶
type ProviderBuilderOption func(*ProviderBuilder)
ProviderBuilderOption is a function which can be used to set options on the ProviderBuilder.
func WithProviderMetrics ¶
func WithProviderMetrics(metrics telemetry.ProviderMetrics) ProviderBuilderOption
WithProviderMetrics sets the metrics for the ProviderBuilder
Directories
¶
| Path | Synopsis |
|---|---|
|
Package git provides a client for interacting with Git providers
|
Package git provides a client for interacting with Git providers |
|
Package github provides a client for interacting with the GitHub API
|
Package github provides a client for interacting with the GitHub API |
|
mock
Package mockgh is a generated GoMock package.
|
Package mockgh is a generated GoMock package. |
|
Package http implements an HTTP client for interacting with an HTTP API.
|
Package http implements an HTTP client for interacting with an HTTP API. |
|
Package telemetry provides the telemetry interfaces and implementations for providers
|
Package telemetry provides the telemetry interfaces and implementations for providers |