Documentation
¶
Index ¶
- type ContainerManager
- func (cm *ContainerManager) Attach(ctx context.Context, name string, attach *types.AttachConfig) error
- func (cm *ContainerManager) Create(ctx context.Context, name string, config *types.ContainerConfigWrapper) (*types.ContainerCreateResp, error)
- func (cm *ContainerManager) List(ctx context.Context) ([]*types.ContainerInfo, error)
- func (cm *ContainerManager) Restore(ctx context.Context) error
- func (cm *ContainerManager) Start(ctx context.Context, cfg types.ContainerStartConfig) (err error)
- func (cm *ContainerManager) Stop(ctx context.Context, name string, timeout time.Duration) error
- type ContainerMgr
- type ImageManager
- func (mgr *ImageManager) ListImages(ctx context.Context, filters string) ([]types.Image, error)
- func (mgr *ImageManager) PullImage(pctx context.Context, image, tag string, out io.Writer) error
- func (mgr *ImageManager) SearchImages(ctx context.Context, name string, registry string) ([]types.SearchResultItem, error)
- type ImageMgr
- type SystemManager
- type SystemMgr
- type VolumeManager
- func (vm *VolumeManager) Attach(ctx context.Context, name string, options map[string]string) (*types.Volume, error)
- func (vm *VolumeManager) Create(ctx context.Context, name, driver string, options, labels map[string]string) error
- func (vm *VolumeManager) Detach(ctx context.Context, name string, options map[string]string) (*types.Volume, error)
- func (vm *VolumeManager) Info(ctx context.Context, name string) (*types.Volume, error)
- func (vm *VolumeManager) List(ctx context.Context, labels map[string]string) ([]string, error)
- func (vm *VolumeManager) Path(ctx context.Context, name string) (string, error)
- func (vm *VolumeManager) Remove(ctx context.Context, name string) error
- type VolumeMgr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerManager ¶
type ContainerManager struct { Store *meta.Store Client *ctrd.Client NameToID *collect.SafeMap ImageMgr ImageMgr VolumeMgr VolumeMgr IOs *containerio.Cache // contains filtered or unexported fields }
ContainerManager is the default implement of interface ContainerMgr.
func NewContainerManager ¶
func NewContainerManager(ctx context.Context, store *meta.Store, cli *ctrd.Client, imgMgr ImageMgr, volMgr VolumeMgr) (*ContainerManager, error)
NewContainerManager creates a brand new container manager.
func (*ContainerManager) Attach ¶
func (cm *ContainerManager) Attach(ctx context.Context, name string, attach *types.AttachConfig) error
Attach attachs a container's io.
func (*ContainerManager) Create ¶
func (cm *ContainerManager) Create(ctx context.Context, name string, config *types.ContainerConfigWrapper) (*types.ContainerCreateResp, error)
Create checks passed in parameters and create a Container object whose status is set at Created.
func (*ContainerManager) List ¶
func (cm *ContainerManager) List(ctx context.Context) ([]*types.ContainerInfo, error)
List returns the container's list.
func (*ContainerManager) Restore ¶
func (cm *ContainerManager) Restore(ctx context.Context) error
Restore containers from meta store to memory and recover those container.
func (*ContainerManager) Start ¶
func (cm *ContainerManager) Start(ctx context.Context, cfg types.ContainerStartConfig) (err error)
Start a pre created Container.
type ContainerMgr ¶
type ContainerMgr interface { // Create a new container. Create(ctx context.Context, name string, config *types.ContainerConfigWrapper) (*types.ContainerCreateResp, error) // Start a container. Start(ctx context.Context, config types.ContainerStartConfig) error // Stop a container. Stop(ctx context.Context, name string, timeout time.Duration) error // Attach a container. Attach(ctx context.Context, name string, attach *types.AttachConfig) error // List returns the list of containers. List(ctx context.Context) ([]*types.ContainerInfo, error) }
ContainerMgr as an interface defines all operations against container.
type ImageManager ¶
type ImageManager struct { // DefaultRegistry is the default registry of daemon. // When users do not specify image repo in image name, // daemon will automatically pull images from DefaultRegistry. // TODO: make DefaultRegistry can be reloaded. DefaultRegistry string // contains filtered or unexported fields }
ImageManager is an implementation of interface ImageMgr. It is a stateless manager, and it will never store image details. When image details needed from users, ImageManager interacts with containerd to get details.
func NewImageManager ¶
NewImageManager initializes a brand new image manager.
func (*ImageManager) ListImages ¶
ListImages lists images stored by containerd.
func (*ImageManager) SearchImages ¶
func (mgr *ImageManager) SearchImages(ctx context.Context, name string, registry string) ([]types.SearchResultItem, error)
SearchImages searches imaged from specified registry.
type ImageMgr ¶
type ImageMgr interface { // PullImage pulls images from specified registry. PullImage(ctx context.Context, image, tag string, out io.Writer) error // ListImages lists images stored by containerd. ListImages(ctx context.Context, filters string) ([]types.Image, error) // Search Images from specified registry. SearchImages(ctx context.Context, name string, registry string) ([]types.SearchResultItem, error) }
ImageMgr as an interface defines all operations against images.
type SystemManager ¶
type SystemManager struct {
// contains filtered or unexported fields
}
SystemManager is an instance of system management.
func NewSystemManager ¶
func NewSystemManager(cfg *config.Config) (*SystemManager, error)
NewSystemManager creates a brand new system manager.
func (*SystemManager) Info ¶
func (mgr *SystemManager) Info() (types.SystemInfo, error)
Info shows system information of daemon.
func (*SystemManager) Version ¶
func (mgr *SystemManager) Version() (types.SystemVersion, error)
Version shows version of daemon.
type SystemMgr ¶
type SystemMgr interface { Info() (types.SystemInfo, error) Version() (types.SystemVersion, error) }
SystemMgr as an interface defines all operations against host.
type VolumeManager ¶
type VolumeManager struct {
// contains filtered or unexported fields
}
VolumeManager is the default implement of interface VolumeMgr.
func NewVolumeManager ¶
NewVolumeManager creates a brand new volume manager.
func (*VolumeManager) Attach ¶
func (vm *VolumeManager) Attach(ctx context.Context, name string, options map[string]string) (*types.Volume, error)
Attach is used to bind a volume to container.
func (*VolumeManager) Create ¶
func (vm *VolumeManager) Create(ctx context.Context, name, driver string, options, labels map[string]string) error
Create is used to create volume.
func (*VolumeManager) Detach ¶
func (vm *VolumeManager) Detach(ctx context.Context, name string, options map[string]string) (*types.Volume, error)
Detach is used to unbind a volume from container.
type VolumeMgr ¶
type VolumeMgr interface { // Create is used to create volume. Create(ctx context.Context, name, driver string, options, labels map[string]string) error // Remove is used to delete an existing volume. Remove(ctx context.Context, name string) error // List returns all volumes on this host. List(ctx context.Context, labels map[string]string) ([]string, error) // Info returns the information of volume that specified name/id. Info(ctx context.Context, name string) (*types.Volume, error) // Path returns the mount path of volume. Path(ctx context.Context, name string) (string, error) // Attach is used to bind a volume to container. Attach(ctx context.Context, name string, options map[string]string) (*types.Volume, error) // Detach is used to unbind a volume from container. Detach(ctx context.Context, name string, options map[string]string) (*types.Volume, error) }
VolumeMgr defines interface to manage container volume.