def

package module
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: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data"`
}

type Container

type Container struct {
	Name    string            `json:"name"`
	Image   string            `json:"image"`
	Environ map[string]string `json:"environ,omitempty"`
	Cmd     []string          `json:"cmd,omitempty"`
	Ports   []uint16          `json:"ports,omitempty"`
	Mounts  ContainerMounts   `json:"mounts,omitempty"`
}

type ContainerData

type ContainerData struct {
	Id       string `json:"id"`
	Hostname string `json:"hostname"`
	// <internal port> -> <external port>
	Ports map[string]int `json:"ports"`
}

func NewContainerData

func NewContainerData(id, hostname string) *ContainerData

type ContainerFileMounts

type ContainerFileMounts struct {
	Path     string `json:"path"`
	Bytes    []byte `json:"bytes"`
	ReadOnly bool   `json:"readonly"`
}

type ContainerMounts

type ContainerMounts struct {
	Files map[string]ContainerFileMounts
}

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) String

func (d Duration) String() string

func (Duration) ToDuration

func (d Duration) ToDuration() time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type EnvOptions

type EnvOptions struct {
	KeepAlive        Duration `json:"keep_alive,omitempty"`
	DisableDiscovery bool     `json:"disable_discovery,omitempty"`
}

type Image

type Image struct {
	Name       string                 `json:"name"`
	Parameters map[string]interface{} `json:"parameters"`
}

type InputEnv

type InputEnv struct {
	// Environment name
	Name string `json:"name"`
	// Environment description
	Description string `json:"description,omitempty"`
	// Templates to use
	Templates []*Tpl `json:"templates,omitempty"`

	// Additional env options
	Options *EnvOptions `json:"options"`
}

func (*InputEnv) Validate

func (ed *InputEnv) Validate() error

type OutputEnv

type OutputEnv struct {
	Id              string                `json:"id"`
	Name            string                `json:"name"`
	Description     string                `json:"description"`
	WsDir           string                `json:"ws_dir" mapstructure:"ws_dir"`
	MountDir        string                `json:"mount_dir" mapstructure:"mount_dir"`
	NetId           string                `json:"net_id" mapstructure:"net_id"`
	Created         string                `json:"created"`
	Keepalive       string                `json:"keep_alive" mapstructure:"keep_alive"`
	ExternalAddress string                `json:"external_address" mapstructure:"external_address"`
	Templates       map[string][]*TplData `json:"templates"` // tpl name -> [TplData]
}

func (*OutputEnv) GetContainer

func (e *OutputEnv) GetContainer(tplName string, tplIdx int,
	contName string) (*ContainerData, error)

func (*OutputEnv) GetContainerByPath

func (e *OutputEnv) GetContainerByPath(path []string,
	contName string) (*ContainerData, error)

Path element must be defined in the format: <template>|<index>

type PatchEnv

type PatchEnv struct {
	StopContainers    []string `json:"stop_containers,omitempty"`
	RestartContainers []string `json:"restart_containers,omitempty"`
	Templates         []*Tpl   `json:"templates,omitempty"`
}

type Tpl

type Tpl struct {
	Tpl        string    `json:"tpl"`
	Parameters TplParams `json:"parameters,omitempty"`
}

type TplData

type TplData struct {
	// Container name -> <internal port> -> "<host>:<external-port>"
	Containers map[string]*ContainerData `json:"containers"`
	// Imported templates -> tpl name -> [TplData]
	Templates map[string][]*TplData `json:"templates"`
}

type TplInfo

type TplInfo struct {
	Description string                   `json:"description,omitempty" mapstructure:"description"`
	Parameters  map[string]*TplInfoParam `json:"parameters,omitempty" mapstructure:"parameters"`
	DataDir     []string                 `json:"data_dir" mapstructure:"data_dir"`
}

type TplInfoParam

type TplInfoParam struct {
	Description string      `json:"description,omitempty" mapstructure:"description"`
	Type        string      `json:"type,omitempty" mapstructure:"type"`
	Mandatory   bool        `json:"mandatory,omitempty" mapstructure:"mandatory"`
	Default     interface{} `json:"default,omitempty" mapstructure:"default"`
}

type TplParams

type TplParams = map[string]interface{}

Jump to

Keyboard shortcuts

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