container

package
v0.0.0-...-88edc58 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

View Source
const STARTING_SUBNET string = "10.10.0.0/16"

Variables

This section is empty.

Functions

func GetAuth

func GetAuth(image string, runtime *runtime.Runtime) string

func GetContainers

func GetContainers() []types.Container

func GetContainersAllStates

func GetContainersAllStates() []types.Container

Types

type ByDepenendecies

type ByDepenendecies []*Container

func (ByDepenendecies) Len

func (d ByDepenendecies) Len() int

func (ByDepenendecies) Less

func (d ByDepenendecies) Less(i, j int) bool

func (ByDepenendecies) Swap

func (d ByDepenendecies) Swap(i, j int)

type Container

type Container struct {
	Static  Static
	Runtime Runtime
	Exports Exports
	Status  Status
}

func Existing

func Existing(name string) *Container

func NewContainer

func NewContainer() *Container

func NewContainerFromDefinition

func NewContainerFromDefinition(runtime *runtime.Runtime, name string, definition v1.Container) *Container

func (*Container) CheckIfImagePresent

func (container *Container) CheckIfImagePresent(ctx context.Context, cli *client.Client) bool

func (*Container) ConnectToTheSameNetwork

func (container *Container) ConnectToTheSameNetwork(containerId string, networkId string) error

func (*Container) CopyFromContainer

func (container *Container) CopyFromContainer(pathContainer string, pathHost string) error

func (*Container) CopyToContainer

func (container *Container) CopyToContainer(reader io.Reader, pathContainer string) error

func (*Container) CreateNetwork

func (container *Container) CreateNetwork() error

func (*Container) Delete

func (container *Container) Delete() error

func (*Container) Exec

func (container *Container) Exec(command []string) ExecResult

func (*Container) FindNetwork

func (container *Container) FindNetwork() bool

func (*Container) FindNetworkAlias

func (container *Container) FindNetworkAlias(endpointName string, networkId string) bool

func (*Container) GenerateLabels

func (container *Container) GenerateLabels() map[string]string

func (*Container) GenerateNetworkSubnet

func (container *Container) GenerateNetworkSubnet() (string, error)

func (*Container) Get

func (container *Container) Get() *types.Container

func (*Container) GetDockerAuth

func (container *Container) GetDockerAuth() types.ImagePullOptions

func (*Container) GetDomain

func (container *Container) GetDomain() string

func (*Container) GetFromId

func (container *Container) GetFromId(runtimeId string) *types.Container

func (*Container) GetHeadlessDomain

func (container *Container) GetHeadlessDomain() string

func (*Container) GetNetwork

func (container *Container) GetNetwork() *network.NetworkingConfig

func (*Container) HasDependencyOn

func (container *Container) HasDependencyOn(kind string, group string, identifier string) bool

func (*Container) Prepare

func (container *Container) Prepare(db *badger.DB) bool

func (*Container) PullImage

func (container *Container) PullImage(ctx context.Context, cli *client.Client) error

func (*Container) Rename

func (container *Container) Rename(newName string) error

func (*Container) Restart

func (container *Container) Restart() bool

func (*Container) Run

func (container *Container) Run(runtime *runtime.Runtime, Badger *badger.DB, dnsCache *dns.Records) (*types.Container, error)

func (*Container) Start

func (container *Container) Start() bool

func (*Container) Stop

func (container *Container) Stop() bool

type ExecResult

type ExecResult struct {
	Stdout string
	Stderr string
	Exit   int
}

type Exports

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

type Network

type Network struct {
	NetworkId string
	IP        string
}

type Resource

type Resource struct {
	Identifier string
	Key        string
	Data       map[string]any
	MountPoint string
}

type Runtime

type Runtime struct {
	Auth               string
	Id                 string
	Networks           map[string]Network
	State              string
	FoundRunning       bool
	FirstObserved      bool
	Ready              bool
	Configuration      map[string]any
	Resources          []Resource
	ObjectDependencies []database.FormatStructure
}

type Static

type Static struct {
	Name                   string
	GeneratedName          string
	GeneratedNameNoProject string
	Labels                 map[string]string
	Group                  string
	Image                  string
	Tag                    string
	Replicas               int
	Networks               []string
	Env                    []string
	Entrypoint             []string
	Command                []string
	MappingFiles           []map[string]string
	MappingPorts           []network.PortMappings
	ExposedPorts           []string
	MountFiles             []string
	Capabilities           []string
	NetworkMode            string
	Privileged             bool
	Definition             v1.Container
}

type Status

type Status struct {
	DependsSolved   bool
	BackOffRestart  bool
	Healthy         bool
	Ready           bool
	Running         bool
	Reconciling     bool
	DefinitionDrift bool
	PendingDelete   bool
}

Jump to

Keyboard shortcuts

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