providers

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package providers contains general utilities for interacting with providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderBuilder added in v0.0.4

type ProviderBuilder struct {
	// contains filtered or unexported fields
}

ProviderBuilder is a utility struct which allows for the creation of provider clients.

func GetProviderBuilder added in v0.0.4

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 added in v0.0.4

func NewProviderBuilder(
	p *db.Provider,
	tokenInf db.ProviderAccessToken,
	tok string,
	opts ...ProviderBuilderOption,
) *ProviderBuilder

NewProviderBuilder creates a new provider builder.

func (*ProviderBuilder) GetGit added in v0.0.4

func (pb *ProviderBuilder) GetGit() (*gitclient.Git, error)

GetGit returns a git client for the provider.

func (*ProviderBuilder) GetGitHub added in v0.0.4

func (pb *ProviderBuilder) GetGitHub(ctx context.Context) (*ghclient.RestClient, error)

GetGitHub returns a github client for the provider.

func (*ProviderBuilder) GetHTTP added in v0.0.4

func (pb *ProviderBuilder) GetHTTP(ctx context.Context) (provinfv1.REST, error)

GetHTTP returns a github client for the provider.

func (*ProviderBuilder) GetName added in v0.0.4

func (pb *ProviderBuilder) GetName() string

GetName returns the name of the provider instance as defined in the database.

func (*ProviderBuilder) GetRepoLister added in v0.0.7

func (pb *ProviderBuilder) GetRepoLister(ctx context.Context) (provinfv1.RepoLister, error)

GetRepoLister returns a repo lister for the provider.

func (*ProviderBuilder) GetToken added in v0.0.4

func (pb *ProviderBuilder) GetToken() string

GetToken returns the token for the provider.

func (*ProviderBuilder) Implements added in v0.0.4

func (pb *ProviderBuilder) Implements(impl db.ProviderType) bool

Implements returns true if the provider implements the given type.

type ProviderBuilderOption added in v0.0.10

type ProviderBuilderOption func(*ProviderBuilder)

ProviderBuilderOption is a function which can be used to set options on the ProviderBuilder.

func WithProviderMetrics added in v0.0.10

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

Jump to

Keyboard shortcuts

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