yaman

package
v0.0.0-...-ac6e8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(rootDir, id string, opts AttachOpts) error

func CleanUp

func CleanUp(rootDir, id string) error

func CopyLogs

func CopyLogs(rootDir, id string, opts CopyLogsOpts) error

CopyLogs copies the logs of a container to the writers specified in the options.

func Create

func Create(rootDir, imageName string, pullOpts registry.PullOpts, containerOpts container.ContainerOpts, shimOpts shim.ShimOpts) (*shim.Shim, *container.Container, error)

func Delete

func Delete(rootDir, id string) error

Delete deletes a container.

func GetContainerIds

func GetContainerIds(rootDir, prefix string) []string

GetContainerIds returns a list of container IDs managed by Yaman.

func ProcessHook

func ProcessHook(rootDir, hookName string, r io.Reader) error

func Restart

func Restart(rootDir, id string) error

func Stop

func Stop(rootDir, id string) error

Types

type AttachOpts

type AttachOpts struct {
	Stdin  bool
	Stdout bool
	Stderr bool
}

type ContainerInspect

type ContainerInspect struct {
	Id           string
	Root         string
	Config       runtimespec.Spec
	Options      container.ContainerOpts
	Created      time.Time
	Started      time.Time
	Exited       time.Time
	ExposedPorts []network.ExposedPort
	Image        struct {
		image.Image
		Config   imagespec.Image
		Manifest imagespec.Manifest
	}
	Shim struct {
		yacs.YacsState
		Options    shim.ShimOpts
		SocketPath string
	}
}

ContainerInspect is a data transfer structure and represents the result of the `inspect` command.

func Inspect

func Inspect(rootDir, id string) (ContainerInspect, error)

Inspect returns low-level information about a container.

type ContainerList

type ContainerList []ContainerListItem

ContainerList contains the list of containers to show to the user.

func ListContainers

func ListContainers(rootDir string, all bool) (ContainerList, error)

ListContainers returns the list of containers running by default.

Optionally, it can return all containers managed by Yaman (running or not). This function does not return `Container` instances but rather data transfer objects for a "user interface".

type ContainerListItem

type ContainerListItem struct {
	ID           string
	Image        string
	Command      string
	Status       string
	Created      time.Time
	ExposedPorts []network.ExposedPort
}

ContainerListItem contains the data about a container for the user.

type CopyLogsOpts

type CopyLogsOpts struct {
	Timestamps bool
	Stdout     io.Writer
	Stderr     io.Writer
}

CopyLogsOpts contains the options for the `CopyLogs` function.

type ImageList

type ImageList []ImageListItem

func ListImages

func ListImages(rootDir string) (ImageList, error)

type ImageListItem

type ImageListItem struct {
	Registry string
	Name     string
	Version  string
	Created  time.Time
	Pulled   time.Time
}

type RunResult

type RunResult struct {
	ContainerID string
	ExitStatus  int
}

RunResult represents the return value of the `Run` function.

func Run

func Run(rootDir, imageName string, pullOpts registry.PullOpts, containerOpts container.ContainerOpts, shimOpts shim.ShimOpts) (RunResult, error)

Run runs a command in a new container. We return the ID of the container on success and an error otherwise.

type StartOpts

type StartOpts struct {
	Attach      bool
	Interactive bool
}

type StartResult

type StartResult struct {
	ExitStatus int
}

func Start

func Start(rootDir, id string, opts StartOpts) (StartResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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