hyper: github.com/BrickXu/hyper/daemon Index | Files | Directories

package daemon

import "github.com/BrickXu/hyper/daemon"

Index

Package Files

attach.go daemon.go exec.go images.go info.go kill.go list.go logs.go pause.go rename.go rm.go run.go server.go servicediscovery.go stop.go storage.go tty.go

Constants

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

Variables

var (
    DefaultLogPrefix string = "/var/run/hyper/Pods"
)
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,
}

func InitDockerCfg Uses

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

type AufsStorage Uses

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

func (*AufsStorage) CleanUp Uses

func (*AufsStorage) CleanUp() error

func (*AufsStorage) CleanupContainer Uses

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

func (*AufsStorage) CreateVolume Uses

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

func (*AufsStorage) Init Uses

func (*AufsStorage) Init() error

func (*AufsStorage) InjectFile Uses

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

func (*AufsStorage) PrepareContainer Uses

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

func (*AufsStorage) RemoveVolume Uses

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

func (*AufsStorage) RootPath Uses

func (a *AufsStorage) RootPath() string

func (*AufsStorage) Type Uses

func (a *AufsStorage) Type() string

type BtrfsStorage Uses

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

func (*BtrfsStorage) CleanUp Uses

func (*BtrfsStorage) CleanUp() error

func (*BtrfsStorage) CleanupContainer Uses

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

func (*BtrfsStorage) CreateVolume Uses

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

func (*BtrfsStorage) Init Uses

func (*BtrfsStorage) Init() error

func (*BtrfsStorage) InjectFile Uses

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

func (*BtrfsStorage) PrepareContainer Uses

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

func (*BtrfsStorage) RemoveVolume Uses

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

func (*BtrfsStorage) RootPath Uses

func (s *BtrfsStorage) RootPath() string

func (*BtrfsStorage) Type Uses

func (s *BtrfsStorage) Type() string

type ContainerLogsConfig Uses

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 Uses

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 Uses

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

func (*Daemon) AddService Uses

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

func (*Daemon) Attach Uses

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

func (*Daemon) CmdAddService Uses

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

func (*Daemon) CmdAttach Uses

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

func (*Daemon) CmdAuthenticateToRegistry Uses

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

func (*Daemon) CmdCleanPod Uses

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

func (*Daemon) CmdCommitImage Uses

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

func (*Daemon) CmdContainerRename Uses

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

func (*Daemon) CmdCreateContainer Uses

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

func (*Daemon) CmdCreatePod Uses

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 Uses

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

func (*Daemon) CmdExitCode Uses

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

func (*Daemon) CmdGetContainerInfo Uses

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

func (*Daemon) CmdGetContainerLogs Uses

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

func (*Daemon) CmdGetPodInfo Uses

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

func (*Daemon) CmdGetPodStats Uses

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

func (*Daemon) CmdGetServices Uses

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

func (*Daemon) CmdImageDelete Uses

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

func (*Daemon) CmdImagePull Uses

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

func (*Daemon) CmdImagePush Uses

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

func (*Daemon) CmdImages Uses

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

func (*Daemon) CmdKillContainer Uses

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

func (*Daemon) CmdKillPod Uses

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

func (*Daemon) CmdList Uses

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

func (*Daemon) CmdPausePod Uses

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

func (*Daemon) CmdRemoveContainer Uses

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

func (*Daemon) CmdSetPodLabels Uses

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

func (*Daemon) CmdStartContainer Uses

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

func (*Daemon) CmdStartPod Uses

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

func (*Daemon) CmdStopContainer Uses

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

func (*Daemon) CmdStopPod Uses

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

func (*Daemon) CmdSystemInfo Uses

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

func (*Daemon) CmdSystemVersion Uses

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

func (*Daemon) CmdTtyResize Uses

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

func (*Daemon) CmdUnpausePod Uses

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

func (*Daemon) CmdUpdateService Uses

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

func (*Daemon) ContainerRename Uses

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

func (*Daemon) CreateContainerInPod Uses

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

func (*Daemon) CreateExec Uses

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

func (*Daemon) CreatePod Uses

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

func (*Daemon) DeleteService Uses

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

func (*Daemon) DeleteVolumeId Uses

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

func (*Daemon) DestroyAllVm Uses

func (daemon *Daemon) DestroyAllVm() error

func (*Daemon) DestroyAndKeepVm Uses

func (daemon *Daemon) DestroyAndKeepVm() error

func (*Daemon) ExecVM Uses

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

func (*Daemon) ExitCode Uses

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

func (*Daemon) ExportImage Uses

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 Uses

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

func (*Daemon) GetContainerLogs Uses

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

func (*Daemon) GetPodByContainerIdOrName Uses

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

func (*Daemon) GetPodInfo Uses

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

func (*Daemon) GetPodNum Uses

func (daemon *Daemon) GetPodNum() int64

func (*Daemon) GetPodStats Uses

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

func (*Daemon) GetServices Uses

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

func (*Daemon) GetVmByPodId Uses

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

func (*Daemon) KillContainer Uses

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

func (*Daemon) KillExec Uses

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

func (*Daemon) KillPodContainers Uses

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

func (*Daemon) List Uses

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

func (*Daemon) ListContainers Uses

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

func (*Daemon) ListPods Uses

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

func (*Daemon) ListVMs Uses

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

func (*Daemon) LoadImage Uses

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 Uses

func (daemon Daemon) PauseContainer(container string) error

func (Daemon) PausePod Uses

func (daemon Daemon) PausePod(podId string) error

func (*Daemon) ReleaseAllVms Uses

func (daemon *Daemon) ReleaseAllVms() error

func (*Daemon) RemoveContainer Uses

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

func (*Daemon) RemovePod Uses

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

func (*Daemon) Restore Uses

func (daemon *Daemon) Restore() error

func (*Daemon) SetPodLabels Uses

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

func (*Daemon) Shutdown Uses

func (daemon *Daemon) Shutdown() error

func (*Daemon) StartContainer Uses

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

func (*Daemon) StartExec Uses

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

func (*Daemon) StartPod Uses

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

func (*Daemon) StopContainer Uses

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

func (*Daemon) StopPod Uses

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

func (*Daemon) TtyResize Uses

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

func (*Daemon) UnpauseContainer Uses

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

func (*Daemon) UnpausePod Uses

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

func (*Daemon) UpdateService Uses

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

func (*Daemon) WaitContainer Uses

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

func (*Daemon) WritePodAndContainers Uses

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

type DevMapperStorage Uses

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

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

func (*DevMapperStorage) CleanUp Uses

func (dms *DevMapperStorage) CleanUp() error

func (*DevMapperStorage) CleanupContainer Uses

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

func (*DevMapperStorage) CreateVolume Uses

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

func (*DevMapperStorage) Init Uses

func (dms *DevMapperStorage) Init() error

func (*DevMapperStorage) InjectFile Uses

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

func (*DevMapperStorage) PrepareContainer Uses

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

func (*DevMapperStorage) RemoveVolume Uses

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

func (*DevMapperStorage) RootPath Uses

func (dms *DevMapperStorage) RootPath() string

func (*DevMapperStorage) Type Uses

func (dms *DevMapperStorage) Type() string

type OverlayFsStorage Uses

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

func (*OverlayFsStorage) CleanUp Uses

func (*OverlayFsStorage) CleanUp() error

func (*OverlayFsStorage) CleanupContainer Uses

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

func (*OverlayFsStorage) CreateVolume Uses

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

func (*OverlayFsStorage) Init Uses

func (*OverlayFsStorage) Init() error

func (*OverlayFsStorage) InjectFile Uses

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

func (*OverlayFsStorage) PrepareContainer Uses

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

func (*OverlayFsStorage) RemoveVolume Uses

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

func (*OverlayFsStorage) RootPath Uses

func (o *OverlayFsStorage) RootPath() string

func (*OverlayFsStorage) Type Uses

func (o *OverlayFsStorage) Type() string

type RawBlockStorage Uses

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

func (*RawBlockStorage) CleanUp Uses

func (*RawBlockStorage) CleanUp() error

func (*RawBlockStorage) CleanupContainer Uses

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

func (*RawBlockStorage) CreateVolume Uses

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

func (*RawBlockStorage) Init Uses

func (s *RawBlockStorage) Init() error

func (*RawBlockStorage) InjectFile Uses

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

func (*RawBlockStorage) PrepareContainer Uses

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

func (*RawBlockStorage) RemoveVolume Uses

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

func (*RawBlockStorage) RootPath Uses

func (s *RawBlockStorage) RootPath() string

func (*RawBlockStorage) Type Uses

func (s *RawBlockStorage) Type() string

type Storage Uses

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

    Init() error
    CleanUp() error

    PrepareContainer(mountId, sharedDir string, readonly bool) (*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 Uses

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

func BtrfsFactory Uses

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

func DMFactory Uses

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

func OverlayFsFactory Uses

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

func RawBlockFactory Uses

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

func StorageFactory Uses

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

func VBoxStorageFactory Uses

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

type VBoxStorage Uses

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

func (*VBoxStorage) CleanUp Uses

func (*VBoxStorage) CleanUp() error

func (*VBoxStorage) CleanupContainer Uses

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

func (*VBoxStorage) CreateVolume Uses

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

func (*VBoxStorage) Init Uses

func (*VBoxStorage) Init() error

func (*VBoxStorage) InjectFile Uses

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

func (*VBoxStorage) PrepareContainer Uses

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

func (*VBoxStorage) RemoveVolume Uses

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

func (*VBoxStorage) RootPath Uses

func (v *VBoxStorage) RootPath() string

func (*VBoxStorage) Type Uses

func (v *VBoxStorage) Type() string

Directories

PathSynopsis
daemonbuilder
daemondb
legacy
pod

Package daemon imports 44 packages (graph). Updated 2017-10-19. Refresh now. Tools for package owners.