unit

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NOT_STARTED = "not started"
)

Functions

This section is empty.

Types

type Unit

type Unit struct {
	Name        string      `hcl:"name"`
	Description string      `hcl:"description"`
	Groups      []string    `hcl:"groups"`
	Slots       []slot.Slot `hcl:"slot"`

	Status      *status.Status
	CurrentSlot *slot.Slot
	Context     gcontext.Context

	DependsOnRaw []string `hcl:"depends_on"`
	DependsOn    []*Unit
}

func (*Unit) GetContext

func (u *Unit) GetContext() gcontext.Context

func (*Unit) GetName

func (u *Unit) GetName() string

func (*Unit) GetStatus

func (u *Unit) GetStatus() *status.Status

func (*Unit) HasStatus

func (u *Unit) HasStatus(status status.UnitStatus) bool

func (*Unit) IdentifySlot

func (u *Unit) IdentifySlot() (*slot.Slot, error)

func (*Unit) Init

func (u *Unit) Init() error

func (*Unit) InternalStore

func (u *Unit) InternalStore() *store.Store

func (*Unit) OutputFile

func (u *Unit) OutputFile() (*os.File, error)

func (*Unit) ProcessStatus

func (u *Unit) ProcessStatus() string

func (*Unit) Restart

func (u *Unit) Restart() error

func (*Unit) SavePIDFile

func (u *Unit) SavePIDFile(c *exec.Cmd) error

func (*Unit) SetContext

func (u *Unit) SetContext(c gcontext.Context)

func (*Unit) SetCurrentSlot

func (u *Unit) SetCurrentSlot(s *slot.Slot)

func (*Unit) SetRunningStatus

func (u *Unit) SetRunningStatus(stat *status.Status, cb status.StatusCallback)

func (*Unit) Start

func (u *Unit) Start() error

func (*Unit) Stop

func (u *Unit) Stop() error

func (*Unit) Tail

func (u *Unit) Tail() error

func (*Unit) TailWithChan

func (u *Unit) TailWithChan(dataChan chan []byte) (func(), error)

func (*Unit) UnsetCurrentSlot

func (u *Unit) UnsetCurrentSlot()

func (*Unit) Validate

func (u *Unit) Validate() []*gerrors.ErrWithPath

Jump to

Keyboard shortcuts

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