docker

package
v0.0.0-...-eeb3e7f Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NoVPN      = 0
	OnlyVPN    = 1
	VPNBrowser = 2
)

Variables

View Source
var (
	DefaultClient     *docker.Client
	DefaultLinkBridge *defaultBridge

	TooLowMemErr              = errors.New("memory needs to be atleast 50mb")
	InvalidHostBindingErr     = errors.New("hostbing does not have correct format - (ip:)port")
	InvalidMountErr           = errors.New("incorrect mount format - src:dest")
	NoRegistriesToPullFromErr = errors.New("no registries to pull from")
	NoImageErr                = errors.New("unable to find image")
	EmptyDigestErr            = errors.New("empty digest")
	DigestFormatErr           = errors.New("unexpected digest format")
	NoRemoteDigestErr         = errors.New("unable to get digest from remote image")
	NoAvailableIPsErr         = errors.New("no available IPs")
	UnexpectedIPErr           = errors.New("unexpected IP range")
	ContNotCreatedErr         = errors.New("container is not created")

	Registries = map[string]docker.AuthConfiguration{
		"": {},
	}
)

Functions

This section is empty.

Types

type Container

type Container interface {
	Identifier
	virtual.Instance
	BridgeAlias(string) (string, error)
}

func NewContainer

func NewContainer(conf ContainerConfig) Container

type ContainerConfig

type ContainerConfig struct {
	Image        string
	EnvVars      map[string]string
	PortBindings map[string]string
	Labels       map[string]string
	Mounts       []string
	User         string
	Resources    *Resources
	Cmd          []string
	DNS          []string
	UsedPorts    []string
	UseBridge    bool
}

type Host

type Host interface {
	GetDockerHostIP() (string, error)
}

func NewHost

func NewHost() Host

type IPPool

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

func (*IPPool) Get

func (ipp *IPPool) Get() (string, error)

type Identifier

type Identifier interface {
	ID() string
}

type Image

type Image struct {
	Registry string
	Repo     string
	Tag      string
}

func (Image) IsPublic

func (i Image) IsPublic() bool

func (Image) NameWithReg

func (i Image) NameWithReg() string

func (Image) String

func (i Image) String() string

type Network

type Network interface {
	FormatIP(num int) string
	Interface() string
	SetIsVPN(int32)
	Connect(c Container, ip ...int) (int, error)
	io.Closer
}

func NewNetwork

func NewNetwork(isVPN int32) (Network, error)

type NoCredentialsErr

type NoCredentialsErr struct {
	Registry string
}

func (NoCredentialsErr) Error

func (err NoCredentialsErr) Error() string

type NoLocalDigestErr

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

func (NoLocalDigestErr) Error

func (err NoLocalDigestErr) Error() string

type NoLocalImageAvailableErr

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

func (NoLocalImageAvailableErr) Error

func (err NoLocalImageAvailableErr) Error() string

type NoRemoteImageAvailableErr

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

func (NoRemoteImageAvailableErr) Error

func (err NoRemoteImageAvailableErr) Error() string

type Resources

type Resources struct {
	MemoryMB uint
	CPU      float64
}

Jump to

Keyboard shortcuts

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