client

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingTsuruTarget       = fmt.Errorf("rpaasv2: tsuru target cannot be empty")
	ErrMissingTsuruToken        = fmt.Errorf("rpaasv2: tsuru token cannot be empty")
	ErrMissingTsuruService      = fmt.Errorf("rpaasv2: tsuru service cannot be empty")
	ErrMissingInstance          = fmt.Errorf("rpaasv2: instance cannot be empty")
	ErrMissingBlockName         = fmt.Errorf("rpaasv2: block name cannot be empty")
	ErrMissingPath              = fmt.Errorf("rpaasv2: path cannot be empty")
	ErrInvalidMaxReplicasNumber = fmt.Errorf("rpaasv2: max replicas can't be lower than 1")
	ErrInvalidMinReplicasNumber = fmt.Errorf("rpaasv2: min replicas can't be lower than 1 and can't be higher than the maximum number of replicas")
	ErrInvalidCPUUsage          = fmt.Errorf("rpaasv2: CPU usage can't be lower than 1%%")
	ErrInvalidMemoryUsage       = fmt.Errorf("rpaasv2: memory usage can't be lower than 1%%")
	ErrMissingValues            = fmt.Errorf("rpaasv2: values can't be all empty")
)
View Source
var DefaultClientOptions = ClientOptions{
	Timeout: 10 * time.Second,
}

Functions

This section is empty.

Types

type Client

type Client interface {
	GetPlans(ctx context.Context, instance string) ([]types.Plan, *http.Response, error)
	GetFlavors(ctx context.Context, instance string) ([]types.Flavor, *http.Response, error)
	Scale(ctx context.Context, args ScaleArgs) (*http.Response, error)
	Info(ctx context.Context, args InfoArgs) (*types.InstanceInfo, *http.Response, error)
	UpdateCertificate(ctx context.Context, args UpdateCertificateArgs) (*http.Response, error)
	UpdateBlock(ctx context.Context, args UpdateBlockArgs) (*http.Response, error)
	DeleteBlock(ctx context.Context, args DeleteBlockArgs) (*http.Response, error)
	ListBlocks(ctx context.Context, args ListBlocksArgs) ([]types.Block, *http.Response, error)
	DeleteRoute(ctx context.Context, args DeleteRouteArgs) (*http.Response, error)
	ListRoutes(ctx context.Context, args ListRoutesArgs) ([]types.Route, *http.Response, error)
	UpdateRoute(ctx context.Context, args UpdateRouteArgs) (*http.Response, error)
	GetAutoscale(ctx context.Context, args GetAutoscaleArgs) (*types.Autoscale, *http.Response, error)
	UpdateAutoscale(ctx context.Context, args UpdateAutoscaleArgs) (*http.Response, error)
	RemoveAutoscale(ctx context.Context, args RemoveAutoscaleArgs) (*http.Response, error)
}

func NewClient

func NewClient(address, user, password string) (Client, error)

func NewClientThroughTsuru

func NewClientThroughTsuru(target, token, service string) (Client, error)

func NewClientThroughTsuruWithOptions

func NewClientThroughTsuruWithOptions(target, token, service string, opts ClientOptions) (Client, error)

func NewClientWithOptions

func NewClientWithOptions(address, user, password string, opts ClientOptions) (Client, error)

type ClientOptions

type ClientOptions struct {
	Timeout time.Duration
}

type DeleteBlockArgs

type DeleteBlockArgs struct {
	Instance string
	Name     string
}

func (DeleteBlockArgs) Validate

func (args DeleteBlockArgs) Validate() error

type DeleteRouteArgs

type DeleteRouteArgs struct {
	Instance string
	Path     string
}

func (DeleteRouteArgs) Validate

func (args DeleteRouteArgs) Validate() error

type ErrUnexpectedStatusCode

type ErrUnexpectedStatusCode string

func (ErrUnexpectedStatusCode) Error added in v0.9.0

func (statusCode ErrUnexpectedStatusCode) Error() string

type GetAutoscaleArgs added in v0.8.1

type GetAutoscaleArgs struct {
	Instance string
	Raw      bool
}

func (GetAutoscaleArgs) Validate added in v0.8.1

func (args GetAutoscaleArgs) Validate() error

type InfoArgs added in v0.7.4

type InfoArgs struct {
	Instance string
	Raw      bool
}

func (InfoArgs) Validate added in v0.7.4

func (args InfoArgs) Validate() error

type ListBlocksArgs

type ListBlocksArgs struct {
	Instance string
}

func (ListBlocksArgs) Validate

func (args ListBlocksArgs) Validate() error

type ListRoutesArgs

type ListRoutesArgs struct {
	Instance string
}

func (ListRoutesArgs) Validate

func (args ListRoutesArgs) Validate() error

type RemoveAutoscaleArgs added in v0.8.1

type RemoveAutoscaleArgs struct {
	Instance string
}

func (RemoveAutoscaleArgs) Validate added in v0.8.1

func (args RemoveAutoscaleArgs) Validate() error

type ScaleArgs

type ScaleArgs struct {
	Instance string
	Replicas int32
}

func (ScaleArgs) Validate

func (args ScaleArgs) Validate() error

type UpdateAutoscaleArgs added in v0.8.1

type UpdateAutoscaleArgs struct {
	Instance    string
	MinReplicas int32
	MaxReplicas int32
	CPU         int32
	Memory      int32
}

func (UpdateAutoscaleArgs) Validate added in v0.8.1

func (args UpdateAutoscaleArgs) Validate() error

type UpdateBlockArgs

type UpdateBlockArgs struct {
	Instance string
	Name     string
	Content  string
}

func (UpdateBlockArgs) Validate

func (args UpdateBlockArgs) Validate() error

type UpdateCertificateArgs

type UpdateCertificateArgs struct {
	Instance    string
	Name        string
	Certificate string
	Key         string
	// contains filtered or unexported fields
}

func (UpdateCertificateArgs) Validate

func (args UpdateCertificateArgs) Validate() error

type UpdateRouteArgs

type UpdateRouteArgs struct {
	Instance    string
	Path        string
	Destination string
	HTTPSOnly   bool
	Content     string
}

func (UpdateRouteArgs) Validate

func (args UpdateRouteArgs) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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