container

package
v0.6.9-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinary added in v0.6.9

func GetBinary() string

func InitClient

func InitClient() error

func PullImage

func PullImage(ref string) error

func StartContainer

func StartContainer(ref, name string, env []string, replace bool) error

func StopContainer

func StopContainer(name string) error

Types

type Client

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

type Container

type Container struct {
	Ports  PortList
	Image  string
	State  string
	Status string
	Names  NameList
}

func GetContainers

func GetContainers(name string) ([]Container, error)

type Image

type Image struct {
	ID         string
	Repository string
	Tag        string
	RepoTags   []string
	Names      []string
}

func GetImages

func GetImages(ref string) ([]Image, error)

type Name

type Name string

type NameList

type NameList []string

func (*NameList) UnmarshalJSON

func (l *NameList) UnmarshalJSON(b []byte) error

type Params

type Params struct {
	Name    Name
	Env     []string
	Replace bool
}

type PortList

type PortList []int

func (*PortList) UnmarshalJSON

func (l *PortList) UnmarshalJSON(b []byte) error

type Ref

type Ref string

type Runtime

type Runtime interface {
	Binary() string
	Version(context.Context) (RuntimeVersion, error)
	Images(context.Context, Ref) ([]Image, error)
	Containers(context.Context, Name) ([]Container, error)
	Run(context.Context, Ref, Params) error
	Remove(context.Context, Name) error
	Pull(context.Context, Ref) error
}

type RuntimeBinary

type RuntimeBinary string
const (
	RuntimeBinaryNone    RuntimeBinary = "none"
	RuntimeBinaryNerdctl RuntimeBinary = "nerdctl"
	RuntimeBinaryPodman  RuntimeBinary = "podman"
	RuntimeBinaryDocker  RuntimeBinary = "docker"
)

type RuntimeVersion

type RuntimeVersion struct {
	Name   string
	Client struct {
		Version    string
		APIVersion string
	}
	Server struct {
		Version       string
		APIVersion    string
		MinAPIVersion string
	}
}

func GetVersion

func GetVersion() (RuntimeVersion, error)

func (RuntimeVersion) String

func (r RuntimeVersion) String() string

Jump to

Keyboard shortcuts

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