client

package module
Version: v0.0.0-...-d33d243 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileToBase64

func FileToBase64(path string) string

Types

type Client

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

Client structure represents a logical session with xenvman API server

func New

func New(params Params) *Client

Create a new xenvman client If params.ServerAddress is not set, a value from XENV_API_SERVER environment variable will be used

func (*Client) GetEnvInfo

func (cl *Client) GetEnvInfo(id string) (*Env, error)

Get environment info

func (*Client) ListEnvs

func (cl *Client) ListEnvs() ([]*Env, error)

List currently active environments

func (*Client) ListTemplates

func (cl *Client) ListTemplates() (map[string]*def.TplInfo, error)

List available templates

func (*Client) MustCreateEnv

func (cl *Client) MustCreateEnv(envDef *def.InputEnv) *Env

Create xenvman client or panic otherwise

func (*Client) NewEnv

func (cl *Client) NewEnv(envDef *def.InputEnv) (*Env, error)

Create a new environment

type Env

type Env struct {
	*def.OutputEnv
	// contains filtered or unexported fields
}

func (*Env) Keepalive

func (env *Env) Keepalive() error

Send a keepalive message

func (*Env) Patch

func (env *Env) Patch(patch *def.PatchEnv) (*Env, error)

Patch environment

func (*Env) String

func (env *Env) String() string

func (*Env) Terminate

func (env *Env) Terminate() error

Terminate/Delete environment

type Params

type Params struct {
	ServerAddress  string
	RequestTimeout time.Duration
}

Jump to

Keyboard shortcuts

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