paramsbuilder

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    = errors.New("http client not set")
	ErrMissingWorkspace = errors.New("missing workspace name")
)

Functions

This section is empty.

Types

type APIModule

type APIModule struct {
	Label   string // e.g. "crm"
	Version string // e.g. "v3"
}

func (APIModule) String

func (a APIModule) String() string

type Client

type Client struct {
	Caller *common.HTTPClient
}

Client params sets up authenticated proxy HTTP client This can be reused among other param builders by composition.

func (*Client) ValidateParams

func (p *Client) ValidateParams() error

func (*Client) WithAuthenticatedClient

func (p *Client) WithAuthenticatedClient(client common.AuthenticatedHTTPClient)

func (*Client) WithClient

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

type Module

type Module struct {
	Suffix string
}

Module params adds suffix to URL controlling API versions. This is relevant where there are several APIs for different product areas or sub-products, and the APIs are versioned differently or have different ways of constructing URLs from object names.

func (*Module) ValidateParams

func (p *Module) ValidateParams() error

func (*Module) WithModule

func (p *Module) WithModule(module APIModule)

type ParamAssurance

type ParamAssurance interface {
	ValidateParams() error
}

ParamAssurance checks that param data is valid Every param instance must implement it.

type Workspace

type Workspace struct {
	Name string
}

Workspace params sets up varying workspace name.

func (*Workspace) ValidateParams

func (p *Workspace) ValidateParams() error

func (*Workspace) WithWorkspace

func (p *Workspace) WithWorkspace(workspaceRef string)

Jump to

Keyboard shortcuts

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