providers

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 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

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) GetHTTP

func (pb *ProviderBuilder) GetHTTP(ctx context.Context) (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(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

Jump to

Keyboard shortcuts

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