service

package
v0.0.0-...-b52fdba Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalManager

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

A LocalManager manages services with a custom service runner

func NewLocalManager

func NewLocalManager(stateFile string) *LocalManager

NewLocalManager creates a new local manager

func (*LocalManager) Install

func (lsm *LocalManager) Install(service Service) error

Install installs the service

func (*LocalManager) List

func (lsm *LocalManager) List() ([]string, error)

List lists the installed services

func (*LocalManager) String

func (lsm *LocalManager) String() string

func (*LocalManager) Uninstall

func (lsm *LocalManager) Uninstall(name string) error

Uninstall uninstalls the service

type Manager

type Manager interface {
	Install(service Service) error
	Uninstall(serviceName string) error
	List() ([]string, error)
}

A Manager manages services

type Service

type Service struct {
	Name        string
	Directory   string
	Command     []string
	Environment map[string]string
}

A Service represent a long-lived application

type SystemDManager

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

A SystemDManager manages services in systemd

func NewSystemDManager

func NewSystemDManager(unitFilePath string, userMode bool) *SystemDManager

NewSystemDManager creates a new systemd service manager

func (*SystemDManager) Install

func (mgr *SystemDManager) Install(service Service) error

Install installs the service

func (*SystemDManager) List

func (mgr *SystemDManager) List() ([]string, error)

List lists the installed services

func (*SystemDManager) String

func (mgr *SystemDManager) String() string

func (*SystemDManager) Uninstall

func (mgr *SystemDManager) Uninstall(name string) error

Uninstall uninstall a service

type UpstartServiceManager

type UpstartServiceManager struct {
}

func NewUpstartServiceManager

func NewUpstartServiceManager() *UpstartServiceManager

func (*UpstartServiceManager) Install

func (usm *UpstartServiceManager) Install(service Service) error

func (*UpstartServiceManager) List

func (usm *UpstartServiceManager) List() ([]string, error)

func (*UpstartServiceManager) Uninstall

func (usm *UpstartServiceManager) Uninstall(name string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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