Documentation
¶
Index ¶
- func GetSvcMgrName() string
- func NewDockerClient() (dockerAPI, error)
- type DockerService
- func (d *DockerService) ExitCode(name string) (int, error)
- func (d *DockerService) Ice(name string) error
- func (d *DockerService) Install(name, desc, runCmd, workDir string, envVars map[string]string) error
- func (d *DockerService) Remove(name string) error
- func (d *DockerService) Start(name string) error
- func (d *DockerService) Status(name string) (string, error)
- func (d *DockerService) Stop(name string) error
- type LaunchdManager
- type NSSMManager
- type ServiceManager
- type SystemdManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSvcMgrName ¶
func GetSvcMgrName() string
func NewDockerClient ¶ added in v0.6.34
func NewDockerClient() (dockerAPI, error)
NewDockerClient returns a dockerAPI connected to the local Docker daemon via DOCKER_HOST (or the platform default socket). API version is negotiated automatically.
Types ¶
type DockerService ¶ added in v0.6.5
type DockerService struct {
// contains filtered or unexported fields
}
func (*DockerService) ExitCode ¶ added in v0.6.41
func (d *DockerService) ExitCode(name string) (int, error)
ExitCode returns the last exit code of a stopped container. Returns 0 for a clean stop, non-zero for a crash.
func (*DockerService) Ice ¶ added in v0.6.22
func (d *DockerService) Ice(name string) error
Ice stops the container and removes its image to free disk space. The service record is preserved so the container can be redeployed.
func (*DockerService) Install ¶ added in v0.6.5
func (d *DockerService) Install(name, desc, runCmd, workDir string, envVars map[string]string) error
func (*DockerService) Remove ¶ added in v0.6.5
func (d *DockerService) Remove(name string) error
func (*DockerService) Start ¶ added in v0.6.5
func (d *DockerService) Start(name string) error
func (*DockerService) Status ¶ added in v0.6.5
func (d *DockerService) Status(name string) (string, error)
Status returns the container state: "running" | "starting" | "stopped".
func (*DockerService) Stop ¶ added in v0.6.5
func (d *DockerService) Stop(name string) error
type LaunchdManager ¶
type LaunchdManager struct {
DockerService
}
func (*LaunchdManager) Install ¶
func (l *LaunchdManager) Install(name, desc, runCmd, workDir string, envVars map[string]string) error
func (*LaunchdManager) Remove ¶
func (l *LaunchdManager) Remove(name string) error
type NSSMManager ¶
type NSSMManager struct {
DockerService
}
func (*NSSMManager) Install ¶
func (n *NSSMManager) Install(name, desc, runCmd, workDir string, envVars map[string]string) error
func (*NSSMManager) Remove ¶
func (n *NSSMManager) Remove(name string) error
type ServiceManager ¶
type ServiceManager interface {
Status(name string) (string, error)
ExitCode(name string) (int, error)
Install(name, desc, runCmd, workDir string, envVars map[string]string) error
Start(name string) error
Stop(name string) error
Remove(name string) error
Ice(name string) error
}
ServiceManager defines the interface for service management across platforms
func SvcRuntime ¶
func SvcRuntime() (ServiceManager, error)
type SystemdManager ¶
type SystemdManager struct {
DockerService
}
Click to show internal directories.
Click to hide internal directories.