Documentation
¶
Overview ¶
Package providers contains general utilities for interacting with providers.
Index ¶
- func DBToPBAuthFlow(t db.AuthorizationFlow) (minderv1.AuthorizationFlow, bool)
- func DBToPBType(t db.ProviderType) (minderv1.ProviderType, bool)
- func GetCredentialStateForProvider(ctx context.Context, prov db.Provider, s db.Store, cryptoEngine crypto.Engine, ...) string
- type ProviderBuilder
- func (pb *ProviderBuilder) GetGit() (provinfv1.Git, error)
- func (pb *ProviderBuilder) GetGitHub() (provinfv1.GitHub, error)
- func (pb *ProviderBuilder) GetHTTP() (provinfv1.REST, error)
- func (pb *ProviderBuilder) GetName() string
- func (pb *ProviderBuilder) GetRepoLister() (provinfv1.RepoLister, error)
- func (pb *ProviderBuilder) Implements(impl db.ProviderType) bool
- type ProviderBuilderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBToPBAuthFlow ¶ added in v0.0.35
func DBToPBAuthFlow(t db.AuthorizationFlow) (minderv1.AuthorizationFlow, bool)
DBToPBAuthFlow converts a database authorization flow to a protobuf authorization flow.
func DBToPBType ¶ added in v0.0.30
func DBToPBType(t db.ProviderType) (minderv1.ProviderType, bool)
DBToPBType converts a database provider type to a protobuf provider type.
func GetCredentialStateForProvider ¶ added in v0.0.37
func GetCredentialStateForProvider( ctx context.Context, prov db.Provider, s db.Store, cryptoEngine crypto.Engine, provCfg *serverconfig.ProviderConfig, ) string
GetCredentialStateForProvider returns the credential state for the given provider.
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, store db.Store, crypteng crypto.Engine, provCfg *serverconfig.ProviderConfig, 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, ownerFilter sql.NullString, credential provinfv1.Credential, cfg *serverconfig.ProviderConfig, opts ...ProviderBuilderOption, ) *ProviderBuilder
NewProviderBuilder creates a new provider builder.
func (*ProviderBuilder) GetGit ¶
func (pb *ProviderBuilder) GetGit() (provinfv1.Git, error)
GetGit returns a git client for the provider.
func (*ProviderBuilder) GetGitHub ¶
func (pb *ProviderBuilder) GetGitHub() (provinfv1.GitHub, error)
GetGitHub returns a github client for the provider.
func (*ProviderBuilder) GetHTTP ¶
func (pb *ProviderBuilder) GetHTTP() (provinfv1.REST, error)
GetHTTP 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() (provinfv1.RepoLister, error)
GetRepoLister returns a repo lister 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
func WithRestClientCache ¶ added in v0.0.31
func WithRestClientCache(cache ratecache.RestClientCache) ProviderBuilderOption
WithRestClientCache sets the rest client cache for the ProviderBuilder
Directories
¶
| Path | Synopsis |
|---|---|
|
Package credentials provides the implementations for the credentials
|
Package credentials provides the implementations for the credentials |
|
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 |
|
app
Package app provides the GitHub App specific operations
|
Package app provides the GitHub App specific operations |
|
mock
Package mockgh is a generated GoMock package.
|
Package mockgh is a generated GoMock package. |
|
oauth
Package oauth provides a client for interacting with the GitHub API using OAuth 2.0 authorization
|
Package oauth provides a client for interacting with the GitHub API using OAuth 2.0 authorization |
|
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 ratecache provides a cache for the REST clients
|
Package ratecache provides a cache for the REST clients |
|
Package telemetry provides the telemetry interfaces and implementations for providers
|
Package telemetry provides the telemetry interfaces and implementations for providers |