Documentation ¶
Overview ¶
Package docker Date: 2024/07/09 14:13:38 Author: Amu Description:
Package docker Date: 2024/07/09 14:13:56 Author: Amu Description:
Package docker Date: 2024/07/09 14:14:10 Author: Amu Description:
Package docker Date: 2024/07/09 14:13:06 Author: Amu Description:
Package docker Date: 2024/07/09 14:14:31 Author: Amu Description:
Package docker Date: 2024/07/09 14:19:40 Author: Amu Description:
Index ¶
- Constants
- type ContainerSummary
- type IManager
- type ImageSummary
- type Manager
- func (m *Manager) ContainerExists(ctx context.Context, containerID string) (bool, error)
- func (m *Manager) ContainerLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
- func (m *Manager) CopyFileToContainer(ctx context.Context, containerID string, srcFile, dstFile string) error
- func (m *Manager) CreateContainer(ctx context.Context, containerName, imageName, networkName string, ...) (string, error)
- func (m *Manager) CreateNetwork(ctx context.Context, name, driver, subnet, gateway string, ...) (string, error)
- func (m *Manager) DeleteContainer(ctx context.Context, containerID string) error
- func (m *Manager) DeleteImage(ctx context.Context, imageID string) error
- func (m *Manager) DeleteNetwork(ctx context.Context, networkID string) error
- func (m *Manager) ExportImage(ctx context.Context, imageIDs []string, targetFile string) error
- func (m *Manager) GetContainerCpu(ctx context.Context, containerID string) (float64, error)
- func (m *Manager) GetContainerIDByContainerName(ctx context.Context, containerName string) (string, error)
- func (m *Manager) GetContainerMem(ctx context.Context, containerID string) (float64, float64, float64, error)
- func (m *Manager) GetImageByID(ctx context.Context, imageID string) (*ImageSummary, error)
- func (m *Manager) GetImageByName(ctx context.Context, imageName string) (*ImageSummary, error)
- func (m *Manager) GetNetworkByID(ctx context.Context, networkID string) (*NetworkSummary, error)
- func (m *Manager) GetNetworkByName(ctx context.Context, name string) (*NetworkSummary, error)
- func (m *Manager) HasSameNameContainer(ctx context.Context, containerName string) (bool, error)
- func (m *Manager) HasSameNameNetwork(ctx context.Context, networkName string) (bool, error)
- func (m *Manager) ImportImage(ctx context.Context, sourceFile string) error
- func (m *Manager) JoinNetwork(ctx context.Context, containerID, networkID string) error
- func (m *Manager) LeaveNetwork(ctx context.Context, containerID, networkID string) error
- func (m *Manager) ListContainer(ctx context.Context) ([]ContainerSummary, error)
- func (m *Manager) ListImage(ctx context.Context) ([]ImageSummary, error)
- func (m *Manager) ListNetwork(ctx context.Context) ([]NetworkSummary, error)
- func (m *Manager) PruneImages(ctx context.Context) error
- func (m *Manager) PruneNetwork(ctx context.Context) error
- func (m *Manager) PullImage(ctx context.Context, imageName string) error
- func (m *Manager) RenameContainer(ctx context.Context, containerID, newName string) error
- func (m *Manager) RestartContainer(ctx context.Context, containerID string) error
- func (m *Manager) SearchImage(ctx context.Context, imageName string) ([]registry.SearchResult, error)
- func (m *Manager) StartContainer(ctx context.Context, containerID string) error
- func (m *Manager) StopContainer(ctx context.Context, containerID string) error
- func (m *Manager) TagImage(ctx context.Context, oldTag, newTag string) error
- func (m *Manager) Version(ctx context.Context) (*Version, error)
- type NetworkSummary
- type PortMapping
- type SubNetworkConfig
- type Version
Constants ¶
View Source
const ( ServerTypeLabel = "server.type" CreatedByProbe = "created.by.probe" )
View Source
const ( WebServer = "web" HttpServer = "http" DatabaseServer = "database" UnknownServer = "unknown" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerSummary ¶
type ContainerSummary struct { ID string `json:"id"` // ID Name string `json:"name"` // Name Image string `json:"image"` // Image Network string `json:"network"` // Network State string `json:"state"` // State: created running paused restarting removing exited dead Created string `json:"created"` // create time Uptime string `json:"uptime"` // uptime in seconds IP string `json:"ip"` // ip Ports []string `json:"ports"` Volumes []string `json:"volumes"` Environments []string `json:"environments"` Labels map[string]string `json:"labels"` }
type IManager ¶
type IManager interface { Version(context.Context) (*Version, error) ListContainer(ctx context.Context) ([]ContainerSummary, error) HasSameNameContainer(ctx context.Context, containerName string) (bool, error) CreateContainer(ctx context.Context, containerName, imageName, networkName string, ports []string, vols []string, env []string, commands []string, labels map[string]string) (string, error) StartContainer(ctx context.Context, containerID string) error StopContainer(ctx context.Context, containerID string) error RestartContainer(ctx context.Context, containerID string) error DeleteContainer(ctx context.Context, containerID string) error CopyFileToContainer(ctx context.Context, containerID string, srcFile, dstFile string) error GetContainerMem(ctx context.Context, containerID string) (float64, float64, float64, error) GetContainerCpu(ctx context.Context, containerID string) (float64, error) GetContainerIDByContainerName(ctx context.Context, containerName string) (string, error) ContainerLogs(ctx context.Context, containerID string) (io.ReadCloser, error) RenameContainer(ctx context.Context, containerID, newName string) error ListImage(ctx context.Context) ([]ImageSummary, error) DeleteImage(ctx context.Context, imageID string) error PruneImages(ctx context.Context) error SearchImage(ctx context.Context, imageName string) ([]registry.SearchResult, error) PullImage(ctx context.Context, imageName string) error TagImage(ctx context.Context, oldTag, newTag string) error ImportImage(ctx context.Context, sourceFile string) error ExportImage(ctx context.Context, imageIDs []string, targetFile string) error GetImageByName(ctx context.Context, imageName string) (*ImageSummary, error) GetImageByID(ctx context.Context, imageID string) (*ImageSummary, error) ListNetwork(ctx context.Context) ([]NetworkSummary, error) HasSameNameNetwork(ctx context.Context, networkName string) (bool, error) CreateNetwork(ctx context.Context, name, driver, subnet, gateway string, labels map[string]string) (string, error) GetNetworkByID(ctx context.Context, networkID string) (*NetworkSummary, error) DeleteNetwork(ctx context.Context, networkID string) error PruneNetwork(ctx context.Context) error JoinNetwork(ctx context.Context, containerID, networkID string) error LeaveNetwork(ctx context.Context, containerID, networkID string) error }
type ImageSummary ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ContainerExists ¶
func (*Manager) ContainerLogs ¶
func (*Manager) CopyFileToContainer ¶
func (*Manager) CreateContainer ¶
func (*Manager) CreateNetwork ¶
func (*Manager) DeleteContainer ¶
func (*Manager) DeleteImage ¶
func (*Manager) DeleteNetwork ¶
func (*Manager) ExportImage ¶
func (*Manager) GetContainerCpu ¶
func (*Manager) GetContainerIDByContainerName ¶
func (*Manager) GetContainerMem ¶
func (*Manager) GetImageByID ¶
func (*Manager) GetImageByName ¶
func (*Manager) GetNetworkByID ¶
func (*Manager) GetNetworkByName ¶
func (*Manager) HasSameNameContainer ¶
func (*Manager) HasSameNameNetwork ¶
func (*Manager) ImportImage ¶
func (*Manager) JoinNetwork ¶
func (*Manager) LeaveNetwork ¶
func (*Manager) ListContainer ¶
func (m *Manager) ListContainer(ctx context.Context) ([]ContainerSummary, error)
func (*Manager) ListImage ¶
func (m *Manager) ListImage(ctx context.Context) ([]ImageSummary, error)
func (*Manager) ListNetwork ¶
func (m *Manager) ListNetwork(ctx context.Context) ([]NetworkSummary, error)
func (*Manager) RenameContainer ¶
func (*Manager) RestartContainer ¶
func (*Manager) SearchImage ¶
func (*Manager) StartContainer ¶
func (*Manager) StopContainer ¶
type NetworkSummary ¶
type PortMapping ¶
type SubNetworkConfig ¶
Click to show internal directories.
Click to hide internal directories.