installer

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Binaries = iota
	SourceCode
)

Variables

This section is empty.

Functions

func CreateDirAsUser

func CreateDirAsUser(directory string, username string)

func CreateUser

func CreateUser(username string)

func Prepare

func Prepare() error

func Run

func Run(head string, parts ...string) (string, error)

Types

type Config

type Config struct {
	Daemons []*Daemon `json:"daemons"`
}

func (*Config) CreateConfig

func (c *Config) CreateConfig()

func (*Config) GenerateDefault

func (c *Config) GenerateDefault() error

func (*Config) GetAutostartingNodes

func (c *Config) GetAutostartingNodes() []*Daemon

func (*Config) GetConfigForNode

func (c *Config) GetConfigForNode(name string) *Daemon

func (*Config) ReadConfigFromFile

func (c *Config) ReadConfigFromFile(filepath string) error

func (*Config) SaveToFile

func (c *Config) SaveToFile(filepath string) error

func (*Config) Start

func (c *Config) Start(what string)

type Daemon

type Daemon struct {
	Name      string `json:"name"`
	Autostart bool   `json:"autostart"`
}

type InstallSource

type InstallSource uint8

type Installer

type Installer interface {
	Prepare() error
	Install(...string) error
	Update(...string) error
}

func New

func New(s InstallSource) (Installer, error)

type PidFile

type PidFile string

func (*PidFile) Read

func (f *PidFile) Read() int

Read the pidfile.

func (*PidFile) String

func (f *PidFile) String() string

type Process

type Process struct {
	Name    string
	Command string
	Args    []string
	Pidfile PidFile
	ConfDir string
	Pid     int
	Status  *ProcessStatus
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(name, configDir string) *Process

func (*Process) Start

func (p *Process) Start()

func (*Process) Stop

func (p *Process) Stop()

type ProcessStatus

type ProcessStatus struct {
	Running bool
	CPU     string
	Memory  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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