hades

package
v0.0.0-...-fdfc0d7 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound returned when daemon doesn't exist in DB.
	ErrNotFound = errors.New("hades: not found")
	// ErrInitDatabase returned from errors initializing DB.
	ErrInitDatabase = errors.New("hades: error initializing db")
	// ErrAlreadyStarted returned when starting daemon already started.
	ErrAlreadyStarted = errors.New("hades: already started")
	// ErrNotStarted returned when stopping daemon not started.
	ErrNotStarted = errors.New("hades: not started")
)

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	ID       uint64 `json:"id"`
	Cmd      string `json:"cmd"`
	Dir      string `json:"dir,omitempty"`
	Status   string `json:"status"`
	Disabled bool   `json:"disabled"`
}

Daemon represents a single daemon process.

type Hades

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

Hades represents main daemon manager.

func NewHades

func NewHades(db *bolt.DB) (*Hades, error)

NewHades returns new Hades instance from dbPath.

func (*Hades) Add

func (h *Hades) Add(cmd, dir string) (*Daemon, error)

Add adds a new daemon to Hades from cmd, dir.

func (*Hades) Daemons

func (h *Hades) Daemons() ([]*Daemon, error)

Daemons returns array of all daemons.

func (*Hades) Get

func (h *Hades) Get(id uint64) (*Daemon, error)

Get returns a single daemon by id.

func (*Hades) Pause

func (h *Hades) Pause(id uint64) error

Pause sends a "STOP" signal to running daemon to pause it.

func (*Hades) Remove

func (h *Hades) Remove(id uint64) error

Remove removes a daemon from Hades.

func (*Hades) Resume

func (h *Hades) Resume(id uint64) error

Resume sends a "CONT" signal to a paused daemon to resume it.

func (*Hades) Start

func (h *Hades) Start(id uint64) error

Start starts a daemon.

func (*Hades) Stop

func (h *Hades) Stop(id uint64) error

Stop sends "KILL" signal to running daemon.

Jump to

Keyboard shortcuts

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