client

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHost is the default Host
	// found in Meta (info) section of spec file
	DefaultHost string = "localhost"
	// DefaultBasePath is the default BasePath
	// found in Meta (info) section of spec file
	DefaultBasePath string = "/flexlb/v1"
)

Variables

View Source
var Default = NewHTTPClient(nil)

Default flexlb HTTP client.

View Source
var DefaultSchemes = []string{"http", "https"}

DefaultSchemes are the default schemes found in Meta (info) section of spec file

Functions

func LoadConfig

func LoadConfig(file string) (*models.InstanceConfig, error)

Types

type Flexlb

type Flexlb struct {
	Instance instance.ClientService

	Service service.ClientService

	Transport runtime.ClientTransport
}

Flexlb is a client for flexlb

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) *Flexlb

New creates a new flexlb client

func NewHTTPClient

func NewHTTPClient(formats strfmt.Registry) *Flexlb

NewHTTPClient creates a new flexlb HTTP client.

func NewHTTPClientWithConfig

func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Flexlb

NewHTTPClientWithConfig creates a new flexlb HTTP client, using a customizable transport config.

func NewTLSClient

func NewTLSClient(host string, ca string, cert string, key string, insecure bool, formats strfmt.Registry) (*Flexlb, error)

func (*Flexlb) CreateInstance

func (lb *Flexlb) CreateInstance(cfg *models.InstanceConfig) (*models.Instance, error)

func (*Flexlb) DeleteInstance

func (lb *Flexlb) DeleteInstance(name string) error

func (*Flexlb) GetInstance

func (lb *Flexlb) GetInstance(name string) (*models.Instance, error)

func (*Flexlb) GetReadyStatus

func (lb *Flexlb) GetReadyStatus() (models.ReadyStatus, error)

func (*Flexlb) ListInstances

func (lb *Flexlb) ListInstances(name *string) ([]*models.Instance, error)

func (*Flexlb) ModifyInstance

func (lb *Flexlb) ModifyInstance(cfg *models.InstanceConfig) (*models.Instance, error)

func (*Flexlb) SetTransport

func (c *Flexlb) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client and all its subresources

func (*Flexlb) StartInstance

func (lb *Flexlb) StartInstance(name string) (*models.Instance, error)

func (*Flexlb) StopInstance

func (lb *Flexlb) StopInstance(name string) (*models.Instance, error)

type TransportConfig

type TransportConfig struct {
	Host     string
	BasePath string
	Schemes  []string
}

TransportConfig contains the transport related info, found in the meta section of the spec file.

func DefaultTransportConfig

func DefaultTransportConfig() *TransportConfig

DefaultTransportConfig creates a TransportConfig with the default settings taken from the meta section of the spec file.

func (*TransportConfig) WithBasePath

func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig

WithBasePath overrides the default basePath, provided by the meta section of the spec file.

func (*TransportConfig) WithHost

func (cfg *TransportConfig) WithHost(host string) *TransportConfig

WithHost overrides the default host, provided by the meta section of the spec file.

func (*TransportConfig) WithSchemes

func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig

WithSchemes overrides the default schemes, provided by the meta section of the spec file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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