generic

package
v0.0.0-...-42e523d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 7 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) 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(*parameters)

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

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

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.

func WithWorkspace

func WithWorkspace(workspaceRef string) Option

WithWorkspace sets workspace which is used as substitution for URL templates.

Jump to

Keyboard shortcuts

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