container

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitContainerManager

func InitContainerManager(ctx context.Context, client *client.Client)

Types

type ContainerManager

type ContainerManager interface {
	GetAllContainer() ([]types.ContainerInfo, error)
	GetAllImage() ([]types.ImageInfo, error)
	GetAllNetwork() ([]types.NetworkInfo, error)

	GetContainerById(id string) (dockertypes.ContainerJSON, error)
	GetImageById(id string) (dockertypes.ImageInspect, error)
	GetNetworkById(id string) (dockertypes.NetworkResource, error)

	StopContainerById(id string) error
	DeleteContainerById(id string) error
	DeleteImageById(id string) error
	DeleteNetworkById(id string) error

	PullImage(name string, version string) (io.ReadCloser, error) //需要外部关闭readerClose
	BuildImage(dockerfile string) (dockertypes.ImageBuildResponse, error)
	GetContainerLogById(id string) (io.ReadCloser, error) //需要外部关闭readerClose

	CreateContainer(imageId string, env []string, cmd []string, ports map[int]int, containerName string) (containertypes.ContainerCreateCreatedBody, error)
	StartContainer(containerID string) error

	CreateNetwork(name string, subnet string, gateway string) (dockertypes.NetworkCreateResponse, error)
	ConnectNetwork(networkId string, containerId string) error
	DisconnectNetwork(networkId string, containerId string) error

	// ConnContainer(id string) (net.Conn, *bufio.Reader, error)
	ConnContainer(id string) (dockertypes.HijackedResponse, error)
	BashContainer(id string) (*dockertypes.HijackedResponse, error)
}

func GetCM

func GetCM() ContainerManager

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

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