daemon

package
v0.0.0-...-282e76a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	E_NOT_FOUND       = -2
	E_UNDER_OPERATION = -1
	E_OK              = 0
)

Variables

View Source
var (
	DefaultLogPrefix string = "/var/run/hyper/Pods"
)
View Source
var StorageDrivers map[string]func(*dockertypes.Info, *daemondb.DaemonDB) (Storage, error) = map[string]func(*dockertypes.Info, *daemondb.DaemonDB) (Storage, error){
	"devicemapper": DMFactory,
	"aufs":         AufsFactory,
	"overlay":      OverlayFsFactory,
	"btrfs":        BtrfsFactory,
	"rawblock":     RawBlockFactory,
	"vbox":         VBoxStorageFactory,
}

Functions

func InitDockerCfg

func InitDockerCfg(mirrors []string, insecureRegistries []string, graphdriver, root string)

Types

type AufsStorage

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

func (*AufsStorage) CleanUp

func (*AufsStorage) CleanUp() error

func (*AufsStorage) CleanupContainer

func (a *AufsStorage) CleanupContainer(id, sharedDir string) error

func (*AufsStorage) CreateVolume

func (a *AufsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*AufsStorage) Init

func (*AufsStorage) Init() error

func (*AufsStorage) InjectFile

func (a *AufsStorage) InjectFile(src io.Reader, containerId, target, baseDir string, perm, uid, gid int) error

func (*AufsStorage) PrepareContainer

func (a *AufsStorage) PrepareContainer(mountId, sharedDir string) (*runv.VolumeDescription, error)

func (*AufsStorage) RemoveVolume

func (a *AufsStorage) RemoveVolume(podId string, record []byte) error

func (*AufsStorage) RootPath

func (a *AufsStorage) RootPath() string

func (*AufsStorage) Type

func (a *AufsStorage) Type() string

type BtrfsStorage

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

func (*BtrfsStorage) CleanUp

func (*BtrfsStorage) CleanUp() error

func (*BtrfsStorage) CleanupContainer

func (s *BtrfsStorage) CleanupContainer(id, sharedDir string) error

func (*BtrfsStorage) CreateVolume

func (s *BtrfsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*BtrfsStorage) Init

func (*BtrfsStorage) Init() error

func (*BtrfsStorage) InjectFile

func (s *BtrfsStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*BtrfsStorage) PrepareContainer

func (s *BtrfsStorage) PrepareContainer(containerId, sharedDir string) (*runv.VolumeDescription, error)

func (*BtrfsStorage) RemoveVolume

func (s *BtrfsStorage) RemoveVolume(podId string, record []byte) error

func (*BtrfsStorage) RootPath

func (s *BtrfsStorage) RootPath() string

func (*BtrfsStorage) Type

func (s *BtrfsStorage) Type() string

type ContainerLogsConfig

type ContainerLogsConfig struct {
	// if true stream log output
	Follow bool
	// if true include timestamps for each line of log output
	Timestamps bool
	// return that many lines of log output from the end
	Tail string
	// filter logs by returning on those entries after this time
	Since time.Time
	// whether or not to show stdout and stderr as well as log entries.
	UseStdout, UseStderr bool
	OutStream            io.Writer
	Stop                 <-chan bool
}

ContainerLogsConfig holds configs for logging operations. Exists for users of the daemon to to pass it a logging configuration.

type Daemon

type Daemon struct {
	*docker.Daemon
	ID string

	PodList    *pod.PodList
	Factory    factory.Factory
	Host       string
	Storage    Storage
	Hypervisor string
	DefaultLog *pod.GlobalLogConfig
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(cfg *apitypes.HyperConfig) (*Daemon, error)

func (*Daemon) AddService

func (daemon *Daemon) AddService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) Attach

func (daemon *Daemon) Attach(stdin io.ReadCloser, stdout io.WriteCloser, container string) error

func (*Daemon) CmdAddService

func (daemon *Daemon) CmdAddService(podId, data string) (*engine.Env, error)

func (*Daemon) CmdAttach

func (daemon *Daemon) CmdAttach(stdin io.ReadCloser, stdout io.WriteCloser, container string) error

func (*Daemon) CmdAuthenticateToRegistry

func (daemon *Daemon) CmdAuthenticateToRegistry(config *types.AuthConfig) (string, error)

func (*Daemon) CmdCleanPod

func (daemon *Daemon) CmdCleanPod(podId string) (*engine.Env, error)

func (*Daemon) CmdCommitImage

func (daemon *Daemon) CmdCommitImage(name string, cfg *types.ContainerCommitConfig) (*engine.Env, error)

func (*Daemon) CmdContainerRename

func (daemon *Daemon) CmdContainerRename(oldname, newname string) (*engine.Env, error)

func (*Daemon) CmdCreateContainer

func (daemon *Daemon) CmdCreateContainer(podId string, containerArgs []byte) (string, error)

func (*Daemon) CmdCreatePod

func (daemon *Daemon) CmdCreatePod(podArgs string) (*engine.Env, error)

FIXME: there was a `config` argument passed by docker/builder, but we never processed it.

func (*Daemon) CmdDeleteService

func (daemon *Daemon) CmdDeleteService(podId, data string) (*engine.Env, error)

func (*Daemon) CmdExitCode

func (daemon *Daemon) CmdExitCode(containerId, execId string) (int, error)

func (*Daemon) CmdGetContainerInfo

func (daemon *Daemon) CmdGetContainerInfo(name string) (interface{}, error)

func (*Daemon) CmdGetContainerLogs

func (daemon *Daemon) CmdGetContainerLogs(container string, config *ContainerLogsConfig) (err error)

func (*Daemon) CmdGetPodInfo

func (daemon *Daemon) CmdGetPodInfo(podName string) (interface{}, error)

func (*Daemon) CmdGetPodStats

func (daemon *Daemon) CmdGetPodStats(podId string) (interface{}, error)

func (*Daemon) CmdGetServices

func (daemon *Daemon) CmdGetServices(podId string) ([]*apitypes.UserService, error)

func (*Daemon) CmdImageDelete

func (daemon *Daemon) CmdImageDelete(name string, force, prune bool) ([]*apitypes.ImageDelete, error)

func (*Daemon) CmdImagePull

func (daemon *Daemon) CmdImagePull(image, tag string, authConfig *types.AuthConfig, metaHeaders map[string][]string, output io.Writer) error

func (*Daemon) CmdImagePush

func (daemon *Daemon) CmdImagePush(repo, tag string, authConfig *types.AuthConfig, metaHeaders map[string][]string, output io.Writer) error

func (*Daemon) CmdImages

func (daemon *Daemon) CmdImages(args, filter string, all bool) (*engine.Env, error)

func (*Daemon) CmdKillContainer

func (daemon *Daemon) CmdKillContainer(name string, sig int64) (*engine.Env, error)

func (*Daemon) CmdKillPod

func (daemon *Daemon) CmdKillPod(podId, container string, sig int64) (*engine.Env, error)

func (*Daemon) CmdList

func (daemon *Daemon) CmdList(item, podId, vmId string) (*engine.Env, error)

func (*Daemon) CmdPausePod

func (daemon *Daemon) CmdPausePod(podId string) error

func (*Daemon) CmdRemoveContainer

func (daemon *Daemon) CmdRemoveContainer(name string) (*engine.Env, error)

func (*Daemon) CmdSetPodLabels

func (daemon *Daemon) CmdSetPodLabels(podId string, override bool, labels map[string]string) (*engine.Env, error)

func (*Daemon) CmdStartContainer

func (daemon *Daemon) CmdStartContainer(containerId string) (*engine.Env, error)

func (*Daemon) CmdStartPod

func (daemon *Daemon) CmdStartPod(podId string) (*engine.Env, error)

func (*Daemon) CmdStopContainer

func (daemon *Daemon) CmdStopContainer(name string) (*engine.Env, error)

func (*Daemon) CmdStopPod

func (daemon *Daemon) CmdStopPod(podId, stopVm string) (*engine.Env, error)

func (*Daemon) CmdSystemInfo

func (daemon *Daemon) CmdSystemInfo() (*apitypes.InfoResponse, error)

func (*Daemon) CmdSystemVersion

func (daemon *Daemon) CmdSystemVersion() *engine.Env

func (*Daemon) CmdTtyResize

func (daemon *Daemon) CmdTtyResize(containerId, execId string, h, w int) error

func (*Daemon) CmdUnpausePod

func (daemon *Daemon) CmdUnpausePod(podId string) error

func (*Daemon) CmdUpdateService

func (daemon *Daemon) CmdUpdateService(podId, data string) (*engine.Env, error)

func (*Daemon) ContainerRename

func (daemon *Daemon) ContainerRename(oldname, newname string) error

func (*Daemon) CreateContainerInPod

func (daemon *Daemon) CreateContainerInPod(podId string, spec *apitypes.UserContainer) (string, error)

func (*Daemon) CreateExec

func (daemon *Daemon) CreateExec(containerId, cmd string, terminal bool) (string, error)

func (*Daemon) CreatePod

func (daemon *Daemon) CreatePod(podId string, podSpec *apitypes.UserPod) (*pod.XPod, error)

func (*Daemon) DeleteService

func (daemon *Daemon) DeleteService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) DeleteVolumeId

func (daemon *Daemon) DeleteVolumeId(podId string) error

func (*Daemon) DestroyAllVm

func (daemon *Daemon) DestroyAllVm() error

func (*Daemon) DestroyAndKeepVm

func (daemon *Daemon) DestroyAndKeepVm() error

func (*Daemon) ExecVM

func (daemon *Daemon) ExecVM(podID, cmd string, stdin io.ReadCloser, stdout, stderr io.WriteCloser) (int, error)

func (*Daemon) ExitCode

func (daemon *Daemon) ExitCode(containerId, execId string) (int, error)

func (*Daemon) ExportImage

func (daemon *Daemon) ExportImage(names []string, format string, refs map[string]string, outStream io.Writer) error

ExportImage exports a list of images to the given output stream. The exported images are archived into a tar when written to the output stream. All images with the given tag and all versions containing the same tag are exported. names is the set of tags to export, and outStream is the writer which the images are written to.

func (*Daemon) GetContainerInfo

func (daemon *Daemon) GetContainerInfo(name string) (*types.ContainerInfo, error)

func (*Daemon) GetContainerLogs

func (daemon *Daemon) GetContainerLogs(container string, config *ContainerLogsConfig) (err error)

func (*Daemon) GetPodByContainerIdOrName

func (daemon *Daemon) GetPodByContainerIdOrName(name string) (*pod.XPod, error)

func (*Daemon) GetPodInfo

func (daemon *Daemon) GetPodInfo(podName string) (*types.PodInfo, error)

func (*Daemon) GetPodNum

func (daemon *Daemon) GetPodNum() int64

func (*Daemon) GetPodStats

func (daemon *Daemon) GetPodStats(podId string) (interface{}, error)

func (*Daemon) GetServices

func (daemon *Daemon) GetServices(podId string) ([]*apitypes.UserService, error)

func (*Daemon) GetVmByPodId

func (daemon *Daemon) GetVmByPodId(podId string) (string, error)

func (*Daemon) KillContainer

func (daemon *Daemon) KillContainer(name string, sig int64) error

func (*Daemon) KillExec

func (daemon *Daemon) KillExec(containerId string, execId string, signal int64) error

func (*Daemon) KillPodContainers

func (daemon *Daemon) KillPodContainers(podName, container string, sig int64) error

func (*Daemon) List

func (daemon *Daemon) List(item, podId, vmId string) (map[string][]string, error)

func (*Daemon) ListContainers

func (daemon *Daemon) ListContainers(podId, vmId string) ([]*apitypes.ContainerListResult, error)

func (*Daemon) ListPods

func (daemon *Daemon) ListPods(podId, vmId string) ([]*apitypes.PodListResult, error)

func (*Daemon) ListVMs

func (daemon *Daemon) ListVMs(podId, vmId string) ([]*apitypes.VMListResult, error)

func (*Daemon) LoadImage

func (daemon *Daemon) LoadImage(inTar io.ReadCloser, name string, refs map[string]string, outStream io.Writer) error

LoadImage uploads a set of images into the repository. This is the complement of ImageExport. The input stream is an uncompressed tar ball containing images and metadata.

func (Daemon) PauseContainer

func (daemon Daemon) PauseContainer(container string) error

func (Daemon) PausePod

func (daemon Daemon) PausePod(podId string) error

func (*Daemon) ReleaseAllVms

func (daemon *Daemon) ReleaseAllVms() error

func (*Daemon) RemoveContainer

func (daemon *Daemon) RemoveContainer(nameOrId string) error

func (*Daemon) RemovePod

func (daemon *Daemon) RemovePod(podId string) (int, string, error)

func (*Daemon) Restore

func (daemon *Daemon) Restore() error

func (*Daemon) SetPodLabels

func (daemon *Daemon) SetPodLabels(pn string, override bool, labels map[string]string) error

func (*Daemon) Shutdown

func (daemon *Daemon) Shutdown() error

func (*Daemon) StartContainer

func (daemon *Daemon) StartContainer(containerId string) error

func (*Daemon) StartExec

func (daemon *Daemon) StartExec(stdin io.ReadCloser, stdout io.WriteCloser, containerId, execId string) error

func (*Daemon) StartPod

func (daemon *Daemon) StartPod(podId string) error

func (*Daemon) StopContainer

func (daemon *Daemon) StopContainer(container string, graceful int) error

func (*Daemon) StopPod

func (daemon *Daemon) StopPod(podId string) (int, string, error)

func (*Daemon) TtyResize

func (daemon *Daemon) TtyResize(containerId, execId string, h, w int) error

func (*Daemon) UnpauseContainer

func (daemon *Daemon) UnpauseContainer(container string) error

func (*Daemon) UnpausePod

func (daemon *Daemon) UnpausePod(podId string) error

func (*Daemon) UpdateService

func (daemon *Daemon) UpdateService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) WaitContainer

func (daemon *Daemon) WaitContainer(cid string, second int) (int, error)

func (*Daemon) WritePodAndContainers

func (daemon *Daemon) WritePodAndContainers(podId string) error

type DevMapperStorage

type DevMapperStorage struct {
	CtnPoolName string
	VolPoolName string
	DevPrefix   string
	FsType      string

	DmPoolData *dm.DeviceMapper
	// contains filtered or unexported fields
}

func (*DevMapperStorage) CleanUp

func (dms *DevMapperStorage) CleanUp() error

func (*DevMapperStorage) CleanupContainer

func (dms *DevMapperStorage) CleanupContainer(id, sharedDir string) error

func (*DevMapperStorage) CreateVolume

func (dms *DevMapperStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*DevMapperStorage) Init

func (dms *DevMapperStorage) Init() error

func (*DevMapperStorage) InjectFile

func (dms *DevMapperStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*DevMapperStorage) PrepareContainer

func (dms *DevMapperStorage) PrepareContainer(mountId, sharedDir string) (*runv.VolumeDescription, error)

func (*DevMapperStorage) RemoveVolume

func (dms *DevMapperStorage) RemoveVolume(podId string, record []byte) error

func (*DevMapperStorage) RootPath

func (dms *DevMapperStorage) RootPath() string

func (*DevMapperStorage) Type

func (dms *DevMapperStorage) Type() string

type OverlayFsStorage

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

func (*OverlayFsStorage) CleanUp

func (*OverlayFsStorage) CleanUp() error

func (*OverlayFsStorage) CleanupContainer

func (o *OverlayFsStorage) CleanupContainer(id, sharedDir string) error

func (*OverlayFsStorage) CreateVolume

func (o *OverlayFsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*OverlayFsStorage) Init

func (*OverlayFsStorage) Init() error

func (*OverlayFsStorage) InjectFile

func (o *OverlayFsStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*OverlayFsStorage) PrepareContainer

func (o *OverlayFsStorage) PrepareContainer(mountId, sharedDir string) (*runv.VolumeDescription, error)

func (*OverlayFsStorage) RemoveVolume

func (o *OverlayFsStorage) RemoveVolume(podId string, record []byte) error

func (*OverlayFsStorage) RootPath

func (o *OverlayFsStorage) RootPath() string

func (*OverlayFsStorage) Type

func (o *OverlayFsStorage) Type() string

type RawBlockStorage

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

func (*RawBlockStorage) CleanUp

func (*RawBlockStorage) CleanUp() error

func (*RawBlockStorage) CleanupContainer

func (s *RawBlockStorage) CleanupContainer(id, sharedDir string) error

func (*RawBlockStorage) CreateVolume

func (s *RawBlockStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*RawBlockStorage) Init

func (s *RawBlockStorage) Init() error

func (*RawBlockStorage) InjectFile

func (s *RawBlockStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*RawBlockStorage) PrepareContainer

func (s *RawBlockStorage) PrepareContainer(containerId, sharedDir string) (*runv.VolumeDescription, error)

func (*RawBlockStorage) RemoveVolume

func (s *RawBlockStorage) RemoveVolume(podId string, record []byte) error

func (*RawBlockStorage) RootPath

func (s *RawBlockStorage) RootPath() string

func (*RawBlockStorage) Type

func (s *RawBlockStorage) Type() string

type Storage

type Storage interface {
	Type() string
	RootPath() string

	Init() error
	CleanUp() error

	PrepareContainer(mountId, sharedDir string) (*runv.VolumeDescription, error)
	CleanupContainer(id, sharedDir string) error
	InjectFile(src io.Reader, containerId, target, baseDir string, perm, uid, gid int) error
	CreateVolume(podId string, spec *apitypes.UserVolume) error
	RemoveVolume(podId string, record []byte) error
}

func AufsFactory

func AufsFactory(sysinfo *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func BtrfsFactory

func BtrfsFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func DMFactory

func DMFactory(sysinfo *dockertypes.Info, db *daemondb.DaemonDB) (Storage, error)

func OverlayFsFactory

func OverlayFsFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func RawBlockFactory

func RawBlockFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func StorageFactory

func StorageFactory(sysinfo *dockertypes.Info, db *daemondb.DaemonDB) (Storage, error)

func VBoxStorageFactory

func VBoxStorageFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

type VBoxStorage

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

func (*VBoxStorage) CleanUp

func (*VBoxStorage) CleanUp() error

func (*VBoxStorage) CleanupContainer

func (v *VBoxStorage) CleanupContainer(id, sharedDir string) error

func (*VBoxStorage) CreateVolume

func (v *VBoxStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*VBoxStorage) Init

func (*VBoxStorage) Init() error

func (*VBoxStorage) InjectFile

func (v *VBoxStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error

func (*VBoxStorage) PrepareContainer

func (v *VBoxStorage) PrepareContainer(mountId, sharedDir string) (*runv.VolumeDescription, error)

func (*VBoxStorage) RemoveVolume

func (v *VBoxStorage) RemoveVolume(podId string, record []byte) error

func (*VBoxStorage) RootPath

func (v *VBoxStorage) RootPath() string

func (*VBoxStorage) Type

func (v *VBoxStorage) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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