procservice

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAutoRestart       = false
	DefaultRestartDelay      = time.Second * 1
	DefaultRestartMaxRetries = 0
)

Variables

View Source
var (
	ErrInvalidProcessName          = errors.New("invalid process name")
	ErrInvalidProcessCommand       = errors.New("invalid process command")
	ErrMissingProcessConfiguration = errors.New("missing process configuration")
)

Functions

This section is empty.

Types

type ProcessListFilter

type ProcessListFilter struct{}

type Service

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

func New

func New(log logger.Logger, manager *procmanager.Manager, storage Storage) *Service

func (*Service) CreateProcess

func (s *Service) CreateProcess(config *pb.ProcessConfiguration) (*procmanager.ManagedProcess, error)

func (*Service) FindProcess

func (s *Service) FindProcess(nameOrPid string) (*procmanager.ManagedProcess, error)

func (*Service) GetDefaultProcessName

func (s *Service) GetDefaultProcessName(config *pb.ProcessConfiguration) string

func (*Service) ListProcesses

func (s *Service) ListProcesses(filter *ProcessListFilter) []*procmanager.ManagedProcess

func (*Service) RemoveProcess

func (s *Service) RemoveProcess(nameOrPid string) error

func (*Service) RestartProcess

func (s *Service) RestartProcess(nameOrPid string) (*procmanager.ManagedProcess, error)

func (*Service) SanitizeProcessConfig

func (s *Service) SanitizeProcessConfig(config *pb.ProcessConfiguration)

func (*Service) StartPersistent

func (s *Service) StartPersistent() error

func (*Service) StopProcess

func (s *Service) StopProcess(nameOrPid string) (*procmanager.ManagedProcess, error)

func (*Service) UpdateProcess

func (s *Service) UpdateProcess(nameOrPid string, config *pb.ProcessConfiguration, mask protomask.FieldMask) (*procmanager.ManagedProcess, error)

func (*Service) ValidateProcessConfig

func (s *Service) ValidateProcessConfig(config *pb.ProcessConfiguration) error

type Storage

type Storage interface {
	List() ([]*procmanager.ProcessData, error)
	Upsert(process *procmanager.ProcessData) error
	Delete(id string) error
}

Jump to

Keyboard shortcuts

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