cem_lib

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Container

type Container struct {
	ID        string            `json:"id"`
	Name      string            `json:"name"`
	State     ContainerState    `json:"state"`
	Created   time.Time         `json:"created"`
	Started   *time.Time        `json:"started"`
	Image     string            `json:"image"`
	ImageID   string            `json:"image_id"`
	EnvVars   map[string]string `json:"env_vars"`
	Labels    map[string]string `json:"labels"`
	Mounts    []Mount           `json:"mounts"`
	Ports     []Port            `json:"ports"`
	Networks  []ContainerNet    `json:"networks"`
	RunConfig RunConfig         `json:"run_config"`
}

type ContainerCtrlPostRequest

type ContainerCtrlPostRequest struct {
	State ContainerSetState `json:"state"`
}

type ContainerFilter

type ContainerFilter struct {
	Name   string
	State  ContainerState
	Labels map[string]string
}

type ContainerNet

type ContainerNet struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	DomainNames []string `json:"domain_names"`
	Gateway     IPAddr   `json:"gateway"`
	IPAddress   IPAddr   `json:"ip_address"`
	MacAddress  string   `json:"mac_address"`
}

type ContainerSetState

type ContainerSetState string
const (
	ContainerStart   ContainerSetState = "start"
	ContainerStop    ContainerSetState = "stop"
	ContainerRestart ContainerSetState = "restart"
)

func (*ContainerSetState) UnmarshalJSON

func (c *ContainerSetState) UnmarshalJSON(b []byte) (err error)

type ContainerState

type ContainerState string
const (
	InitState       ContainerState = "initialized"
	RunningState    ContainerState = "running"
	RestartingState ContainerState = "restarting"
	StoppedState    ContainerState = "stopped"
	UnhealthyState  ContainerState = "unhealthy"
	UnknownState    ContainerState = "unknown"
)

type ContainersPostResponse

type ContainersPostResponse struct {
	ID string `json:"id"`
}

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON

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

func (Duration) MarshalYAML added in v0.4.0

func (d Duration) MarshalYAML() (any, error)

func (*Duration) UnmarshalJSON

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

func (*Duration) UnmarshalYAML added in v0.4.0

func (d *Duration) UnmarshalYAML(yn *yaml.Node) (err error)

type FileMode added in v0.5.0

type FileMode struct {
	fs.FileMode
}

func (FileMode) MarshalJSON added in v0.5.0

func (m FileMode) MarshalJSON() ([]byte, error)

func (FileMode) MarshalYAML added in v0.5.0

func (m FileMode) MarshalYAML() (any, error)

func (*FileMode) UnmarshalJSON added in v0.5.0

func (m *FileMode) UnmarshalJSON(b []byte) (err error)

func (*FileMode) UnmarshalYAML added in v0.5.0

func (m *FileMode) UnmarshalYAML(yn *yaml.Node) (err error)

type IPAddr

type IPAddr struct {
	net.IP
}

func (*IPAddr) UnmarshalJSON

func (i *IPAddr) UnmarshalJSON(b []byte) (err error)

type Image

type Image struct {
	ID      string            `json:"id"`
	Created time.Time         `json:"created"`
	Size    int64             `json:"size"`
	Arch    string            `json:"arch"`
	Tags    []string          `json:"tags"`
	Digests []string          `json:"digests"`
	Labels  map[string]string `json:"labels"`
}

type ImageFilter

type ImageFilter struct {
	Labels map[string]string
}

type ImagesPostRequest

type ImagesPostRequest struct {
	Image string `json:"image"`
}

type LogOptions

type LogOptions struct {
	MaxLines int
	Since    *time.Time
	Until    *time.Time
}

type Mount

type Mount struct {
	Type     MountType         `json:"type"`
	Source   string            `json:"source"`
	Target   string            `json:"target"`
	ReadOnly bool              `json:"read_only"`
	Labels   map[string]string `json:"labels,omitempty"`
	Size     int64             `json:"size,omitempty"`
	Mode     FileMode          `json:"mode,omitempty"`
}

func (Mount) KeyStr

func (m Mount) KeyStr() string

type MountType

type MountType string
const (
	BindMount   MountType = "bind"
	VolumeMount MountType = "volume"
	TmpfsMount  MountType = "tmpfs"
)

func (*MountType) UnmarshalJSON

func (m *MountType) UnmarshalJSON(b []byte) (err error)

type Network

type Network struct {
	ID      string      `json:"id"`
	Name    string      `json:"name"`
	Type    NetworkType `json:"type"`
	Subnet  Subnet      `json:"subnet"`
	Gateway IPAddr      `json:"gateway"`
}

type NetworkType

type NetworkType string
const (
	BridgeNet  NetworkType = "bridge"
	MACVlanNet NetworkType = "macvlan"
	HostNet    NetworkType = "host"
)

func (*NetworkType) UnmarshalJSON

func (n *NetworkType) UnmarshalJSON(b []byte) (err error)

type Port

type Port struct {
	Number   int           `json:"number"`
	Protocol PortType      `json:"protocol"`
	Bindings []PortBinding `json:"bindings"`
}

func (Port) KeyStr

func (p Port) KeyStr() string

type PortBinding

type PortBinding struct {
	Number    int    `json:"number"`
	Interface IPAddr `json:"interface"`
}

type PortType

type PortType string
const (
	TcpPort  PortType = "tcp"
	UdpPort  PortType = "udp"
	SctpPort PortType = "sctp"
)

func (*PortType) UnmarshalJSON

func (p *PortType) UnmarshalJSON(b []byte) (err error)

type RestartStrategy

type RestartStrategy string
const (
	RestartNever      RestartStrategy = "never"
	RestartAlways     RestartStrategy = "always"
	RestartNotStopped RestartStrategy = "not-stopped"
	RestartOnFail     RestartStrategy = "on-fail"
)

func (*RestartStrategy) UnmarshalJSON

func (r *RestartStrategy) UnmarshalJSON(b []byte) (err error)

func (*RestartStrategy) UnmarshalYAML added in v0.4.0

func (r *RestartStrategy) UnmarshalYAML(yn *yaml.Node) (err error)

type RunConfig

type RunConfig struct {
	RestartStrategy RestartStrategy `json:"restart_strategy" yaml:"restartStrategy"`
	Retries         *int            `json:"retries" yaml:"retries"`
	RemoveAfterRun  bool            `json:"remove_after_run" yaml:"removeAfterRun"`
	StopTimeout     *Duration       `json:"stop_timeout" yaml:"stopTimeout"`
	StopSignal      *string         `json:"stop_signal" yaml:"stopSignal"`
	PseudoTTY       bool            `json:"pseudo_tty" yaml:"pseudoTTY"`
}

type Subnet

type Subnet struct {
	Prefix IPAddr `json:"prefix"`
	Bits   int    `json:"bits"`
}

func (Subnet) KeyStr

func (s Subnet) KeyStr() string

type Volume added in v0.7.0

type Volume struct {
	Name    string            `json:"name"`
	Created time.Time         `json:"created"`
	Labels  map[string]string `json:"labels"`
}

type VolumeFilter added in v0.7.0

type VolumeFilter struct {
	Labels map[string]string
}

Jump to

Keyboard shortcuts

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