api

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Activated = "ACTIVATED"
	Standby   = "STANDBY"
	Failing   = "FAILING"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddIPParams added in v1.8.0

type AddIPParams struct {
	HealthcheckInterval int                  `json:"healthcheck_interval"`
	KeepaliveInterval   int                  `json:"keepalive_interval"`
	Checks              []models.Healthcheck `json:"checks"`
}

type Client

type Client interface {
	ListIPs(ctx context.Context) ([]IP, error)
	GetIP(ctx context.Context, id string) (IP, error)
	AddIP(ctx context.Context, ip string, params AddIPParams) (IP, error)
	RemoveIP(ctx context.Context, id string) error
	TryGetLock(ctx context.Context, id string) error
	Version(ctx context.Context) (string, error)
}

type ClientOpt

type ClientOpt func(HTTPClient) HTTPClient

func WithPassword

func WithPassword(pass string) ClientOpt

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOpt

func WithURL

func WithURL(url string) ClientOpt

func WithUser

func WithUser(user string) ClientOpt

type ErrNotFound added in v1.1.0

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

func (ErrNotFound) Error added in v1.1.0

func (e ErrNotFound) Error() string

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(opts ...ClientOpt) HTTPClient

func (HTTPClient) AddIP

func (c HTTPClient) AddIP(ctx context.Context, ip string, params AddIPParams) (IP, error)

func (HTTPClient) GetIP

func (c HTTPClient) GetIP(ctx context.Context, id string) (IP, error)

func (HTTPClient) ListIPs

func (c HTTPClient) ListIPs(ctx context.Context) ([]IP, error)

func (HTTPClient) RemoveIP

func (c HTTPClient) RemoveIP(ctx context.Context, id string) error

func (HTTPClient) TryGetLock

func (c HTTPClient) TryGetLock(ctx context.Context, id string) error

func (HTTPClient) Version added in v1.1.0

func (c HTTPClient) Version(ctx context.Context) (string, error)

type IP

type IP struct {
	models.IP
	Status string `json:"status,omitempty"`
}

Directories

Path Synopsis
Package apimock is a generated GoMock package.
Package apimock is a generated GoMock package.

Jump to

Keyboard shortcuts

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