service

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode added in v0.8.0

type Mode int

Mode represents how gmbh interacts with the process of the service

const (
	// Remote mode; as in not having been launched from the service launcher
	Remote Mode = 1 + iota

	// Managed mode; as in having been launched from the service launcher
	Managed
)

func (Mode) String added in v0.9.1

func (m Mode) String() string

type Service added in v0.8.0

type Service struct {
	ID      string
	Path    string
	Created time.Time
	Address string
	Mode    Mode

	// LogPath is where the std{out,err} of service's process' output will be
	// directed
	LogPath string

	// Static data associated with the service
	// Static *config.ServiceStatic
	Static *config.ServiceConfig

	// If managed, Process will hold the process controller
	Process process.Manager
}

Service represents a service including all static and runtime data

func NewService added in v0.8.0

func NewService(id string, conf *config.ServiceConfig) (*Service, error)

NewService tries to parse the required info from a config file located at path

func (*Service) EnableGracefulShutdown added in v0.9.1

func (s *Service) EnableGracefulShutdown()

EnableGracefulShutdown tells the process to stop attempting to restart

func (*Service) Kill added in v0.9.1

func (s *Service) Kill()

Kill a process

func (*Service) Restart added in v0.9.1

func (s *Service) Restart() (string, error)

Restart the process

func (*Service) Start added in v0.9.1

func (s *Service) Start(mode string, verbose bool) (pid string, err error)

Start attempts to fork/exec service and returns the pid, else error service must be in managed or remote mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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