daemon

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind uint8
const (
	// KindUser is a daemon that runs as a user process.
	KindUser Kind = 1
	// KindSystem is a daemon that runs as a system process.
	KindSystem Kind = 2
)

func (Kind) MarshalSetting

func (k Kind) MarshalSetting() ([]byte, error)

func (Kind) SettingKind

func (k Kind) SettingKind() settings.Kind

func (Kind) String

func (k Kind) String() string

func (Kind) UnmarshalSetting

func (k Kind) UnmarshalSetting(data []byte) error

UnmarshalSetting updates the Uint setting from a byte slice, interpreting it as an unsigned integer.

type Service

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

func New

func New(s Settings) (*Service, error)

func (*Service) Disable

func (s *Service) Disable() error

Disable disables the service.

func (*Service) Enable

func (s *Service) Enable() error

Enable enables the service.

func (*Service) Install

func (s *Service) Install() error

Install installs the service.

func (*Service) Logs

func (s *Service) Logs() error

func (*Service) Restart

func (s *Service) Restart() error

func (*Service) SetPIDFile

func (s *Service) SetPIDFile(p string)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Status

func (s *Service) Status() (Status, error)

func (*Service) Stop

func (s *Service) Stop() error

func (*Service) Uninstall

func (s *Service) Uninstall() error

Uninstall uninstalls the service.

type Settings

type Settings struct {
	Name        settings.String      `key:"name" default:"Happy Prototype"`
	Description settings.String      `key:"decription" default:"Happy Prototype Daemon"`
	Slug        settings.String      `key:"slug" default:"happy-prototype"`
	Kind        Kind                 `key:"kind" default:"user"`
	Args        settings.StringSlice `key:"args" default:""`
}

type Status

type Status uint
const (
	StatusUnknown Status = iota
	StatusActive
	StatusInactive
	StatusFailed
	StatusReloading
	StatusActivating
	StatusDeactivating
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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