container

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerNetworkName = "skupper"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Version() (*Version, error)
	ContainerList() ([]*Container, error)
	ContainerInspect(id string) (*Container, error)
	ContainerCreate(container *Container) error
	ContainerRemove(id string) error
	ContainerExec(id string, command []string) (string, error)
	ContainerLogs(id string) (string, error)
	ContainerStart(id string) error
	ContainerStop(id string) error
	ContainerRestart(id string) error
	ImageList() ([]*Image, error)
	ImageInspect(id string) (*Image, error)
	ImagePull(id string) error
	NetworkList() ([]*Network, error)
	NetworkInspect(id string) (*Network, error)
	NetworkCreate(network *Network) (*Network, error)
	NetworkRemove(id string) error
	NetworkConnect(id, container string, aliases ...string) error
	NetworkDisconnect(id, container string) error
	VolumeCreate(volume *Volume) (*Volume, error)
	VolumeInspect(id string) (*Volume, error)
	VolumeRemove(id string) error
	VolumeList() ([]*Volume, error)
}

type Container

type Container struct {
	ID            string
	Name          string
	Pod           string
	Image         string
	Env           map[string]string
	Labels        map[string]string
	Annotations   map[string]string
	Networks      map[string]ContainerNetworkInfo
	Mounts        []Volume
	Ports         []Port
	EntryPoint    []string
	Command       []string
	RestartPolicy string
	RestartCount  int
	Running       bool
	CreatedAt     string
	StartedAt     string
	ExitedAt      string
	ExitCode      int
}

func (*Container) EnvSlice

func (c *Container) EnvSlice() []string

func (*Container) FromEnv

func (c *Container) FromEnv(env []string)

func (*Container) NetworkAliases

func (c *Container) NetworkAliases() map[string][]string

func (*Container) NetworkNames

func (c *Container) NetworkNames() []string

type ContainerNetworkInfo

type ContainerNetworkInfo struct {
	ID          string
	IPAddress   string
	IPPrefixLen int
	MacAddress  string
	Gateway     string
	Aliases     []string
}

type Image

type Image struct {
	Id         string
	Repository string
	Created    string
}

type Network

type Network struct {
	ID        string
	Name      string
	Subnets   []*Subnet
	Driver    string
	DNS       bool
	Internal  bool
	Labels    map[string]string
	Options   map[string]string
	CreatedAt string
}

type Port

type Port struct {
	Host     string
	HostIP   string
	Target   string
	Protocol string
}

type Subnet

type Subnet struct {
	Subnet  string
	Gateway string
}

type Version

type Version struct {
	Client VersionInfo
	Server VersionInfo
}

type VersionInfo

type VersionInfo struct {
	Version    string
	APIVersion string
}

type Volume

type Volume struct {
	Name        string
	Source      string
	Destination string
	Mode        string
	RW          bool
	Labels      map[string]string
}

func (*Volume) CreateDataFiles

func (v *Volume) CreateDataFiles(fileData map[string][]byte, overwrite bool) ([]*os.File, error)

func (*Volume) CreateFile

func (v *Volume) CreateFile(name string, data []byte, overwrite bool) (*os.File, error)

func (*Volume) CreateFiles

func (v *Volume) CreateFiles(fileData map[string]string, overwrite bool) ([]*os.File, error)

func (*Volume) DeleteFile

func (v *Volume) DeleteFile(name string, recursive bool) error

func (*Volume) GetLabels

func (v *Volume) GetLabels() map[string]string

func (*Volume) ListFiles

func (v *Volume) ListFiles() ([]os.DirEntry, error)

func (*Volume) ReadFile

func (v *Volume) ReadFile(name string) (string, error)

Jump to

Keyboard shortcuts

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