connector

package
v0.0.0-...-b99b532 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingClient is returned when a connector is created without a client.
	ErrMissingClient = errors.New("missing client")

	// ErrMissingProvider is returned when a connector is created without a provider.
	ErrMissingProvider = errors.New("missing provider")
)

Functions

This section is empty.

Types

type Connector

type Connector struct {
	ProviderInfo *providers.ProviderInfo
	Client       *common.JSONHTTPClient
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector(
	provider providers.Provider,
	opts ...Option,
) (conn *Connector, outErr error)

func (*Connector) Close

func (c *Connector) Close() error

func (*Connector) HTTPClient

func (c *Connector) HTTPClient() *common.HTTPClient

func (*Connector) JSONHTTPClient

func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient

func (*Connector) Provider

func (c *Connector) Provider() providers.Provider

func (*Connector) String

func (c *Connector) String() string

type Option

type Option func(*connectorParams)

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

WithAuthenticatedClient sets the http client to use for the connector. Its usage is optional.

func WithCatalogSubstitutions

func WithCatalogSubstitutions(substitutions map[string]string) Option

WithCatalogSubstitutions sets the provider values to use while making substitutions & reading from providers.yaml. If the provider values are not set, the connector will use error out.

func WithClient

func WithClient(ctx context.Context, client *http.Client, config *oauth2.Config, token *oauth2.Token,
	opts ...common.OAuthOption,
) Option

WithClient sets the http client to use for the connector.

Jump to

Keyboard shortcuts

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