docker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerClient

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

func NewDockerClient

func NewDockerClient() (*DockerClient, error)

func (*DockerClient) Close

func (c *DockerClient) Close() error

func (*DockerClient) CopyFrom

func (c *DockerClient) CopyFrom(containerId, source, dest string) error

func (*DockerClient) CopyTo

func (c *DockerClient) CopyTo(containerId, source, dest string) error

func (*DockerClient) Create

func (c *DockerClient) Create(imgName, containerName, hostName string, volumes []string, ipv6, mpls bool) (string, error)

func (*DockerClient) Exec

func (c *DockerClient) Exec(containerId string, cmd []string) (string, error)

func (*DockerClient) ExecOutStream

func (c *DockerClient) ExecOutStream(containerId string, cmd []string, out io.Writer) error

func (*DockerClient) ExecTty

func (c *DockerClient) ExecTty(containerId string, cmd []string, in io.ReadCloser, out io.Writer, resizeCh chan term.Winsize) error

func (*DockerClient) ExecWithWorkingDir added in v0.1.6

func (c *DockerClient) ExecWithWorkingDir(containerId string, cmd []string, workingDir string) (string, error)

func (*DockerClient) Get

func (c *DockerClient) Get(containerId string) (*types.Container, error)

func (*DockerClient) GetState

func (c *DockerClient) GetState(containerId string) (string, error)

func (*DockerClient) ImagePull

func (c *DockerClient) ImagePull(imgName string) error

func (*DockerClient) IsFileExist added in v0.1.3

func (c *DockerClient) IsFileExist(containerId, filepath string) bool

func (*DockerClient) IsFolderExist added in v0.1.6

func (c *DockerClient) IsFolderExist(containerId, filepath string) bool

func (*DockerClient) IsImagePresent

func (c *DockerClient) IsImagePresent(imgName string) (bool, error)

func (*DockerClient) List

func (c *DockerClient) List(prefix string) ([]NetemContainerList, error)

func (*DockerClient) Pid

func (c *DockerClient) Pid(containerId string) (int, error)

func (*DockerClient) Rm

func (c *DockerClient) Rm(containerId string) error

func (*DockerClient) Start

func (c *DockerClient) Start(containerId string) error

func (*DockerClient) Stop

func (c *DockerClient) Stop(containerId string) error

type DockerNode

type DockerNode struct {
	PrjID          string
	ID             string
	Name           string
	ShortName      string
	Type           string
	Interfaces     map[string]link.IfState
	LocalNetnsName string
	Running        bool
	ConfigLoaded   bool
	Mpls           bool
	Vrfs           []string
	Vrrps          []VrrpOptions
	Volumes        []string
	Logger         *logrus.Entry
}

func NewDockerNode

func NewDockerNode(prjID string, dockerOpts DockerNodeOptions) (*DockerNode, error)

func (*DockerNode) AddInterface

func (n *DockerNode) AddInterface(ifName string, ifIndex int, ns netns.NsHandle) error

func (*DockerNode) CanRunConsole

func (n *DockerNode) CanRunConsole() error

func (*DockerNode) Capture

func (n *DockerNode) Capture(ifIndex int, out io.Writer) error

func (*DockerNode) Close

func (n *DockerNode) Close() error

func (*DockerNode) Console

func (n *DockerNode) Console(shell bool, in io.ReadCloser, out io.Writer, resizeCh chan term.Winsize) error

func (*DockerNode) CopyFrom

func (n *DockerNode) CopyFrom(source, dest string) error

func (*DockerNode) CopyTo

func (n *DockerNode) CopyTo(source, dest string) error

func (*DockerNode) Create

func (n *DockerNode) Create(imgName string, ipv6 bool) error

func (*DockerNode) GetInterfaceName

func (n *DockerNode) GetInterfaceName(ifIndex int) string

func (*DockerNode) GetInterfacesState added in v0.1.1

func (n *DockerNode) GetInterfacesState() map[string]link.IfState

func (*DockerNode) GetName

func (n *DockerNode) GetName() string

func (*DockerNode) GetNetns

func (n *DockerNode) GetNetns() (netns.NsHandle, error)

func (*DockerNode) GetShortName added in v0.1.1

func (n *DockerNode) GetShortName() string

func (*DockerNode) GetStatus

func (n *DockerNode) GetStatus() (DockerNodeStatus, error)

func (*DockerNode) GetType

func (n *DockerNode) GetType() string

func (*DockerNode) IsRunning

func (n *DockerNode) IsRunning() bool

func (*DockerNode) LoadConfig

func (n *DockerNode) LoadConfig(confPath string) ([]string, error)

func (*DockerNode) PrepareInterface

func (n *DockerNode) PrepareInterface(ifName string)

func (*DockerNode) ReadConfigFiles added in v0.2.0

func (n *DockerNode) ReadConfigFiles(confDir string) (map[string][]byte, error)

func (*DockerNode) Save

func (n *DockerNode) Save(dstPath string) error

func (*DockerNode) SetInterfaceState

func (n *DockerNode) SetInterfaceState(ifIndex int, state link.IfState) error

func (*DockerNode) Start

func (n *DockerNode) Start() error

func (*DockerNode) Stop

func (n *DockerNode) Stop() error

type DockerNodeOptions

type DockerNodeOptions struct {
	Name      string
	ShortName string
	Type      string
	ImgName   string
	Ipv6      bool
	Mpls      bool
	Vrfs      []string
	Vrrps     []VrrpOptions
	Volumes   []string
}

type DockerNodeStatus

type DockerNodeStatus struct {
	Running bool
}

type NetemContainerList

type NetemContainerList struct {
	Container types.Container
	Name      string
}

type VrrpOptions added in v0.1.1

type VrrpOptions struct {
	Interface int
	Group     int
	Address   string
}

Jump to

Keyboard shortcuts

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