client

package
v0.0.0-...-632707f Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRequestTimeout  = time.Duration(30) * time.Second
	DefaultPoolingInterval = time.Duration(5) * time.Second
)
View Source
const (
	ErrConfigNoHost = ConfigError("no host specified")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API client.API

func NewAPI

func NewAPI(cli client.Client, poolingInterval time.Duration) API

type Client

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

func NewClient

func NewClient(cfg Config) (*Client, error)

func NewClientWithExecutor

func NewClientWithExecutor(
	exc request.Executor,
	poolingInterval time.Duration,
) *Client

func (*Client) API

func (cli *Client) API() API

func (*Client) AuthenticateWithCredentials

func (cli *Client) AuthenticateWithCredentials(
	username, password string,
) error

func (*Client) AuthenticateWithToken

func (cli *Client) AuthenticateWithToken(id, secret string) error

func (*Client) EndAtomicBlock

func (cli *Client) EndAtomicBlock()

func (*Client) Request

func (cli *Client) Request(
	method, resource string,
	form request.Values,
	out interface{},
) error

func (*Client) StartAtomicBlock

func (cli *Client) StartAtomicBlock()

func (*Client) Version

func (cli *Client) Version() (*types.Version, error)

type Config

type Config struct {
	Host   string
	Port   uint16
	Path   string
	Secure bool

	HTTPTransport   *http.Transport
	RequestTimeout  time.Duration
	PoolingInterval time.Duration
}

func (Config) Endpoint

func (cfg Config) Endpoint() (*url.URL, error)

type ConfigError

type ConfigError string

func (ConfigError) Error

func (e ConfigError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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