model

package
v0.0.0-...-dcf77fd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(m *Root) error

func Walk

func Walk(v Visitor, node Node)

Types

type ByteUnits

type ByteUnits int

type Duration

type Duration time.Duration

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(bytes []byte) error

type File

type File struct {
	Name    string
	Path    string
	Content string
}

type FileSystem

type FileSystem struct {
	Root  string
	Files []*File
}

type Group

type Group struct {
	Name     string   `yaml:"name"`
	Programs []string `yaml:"programs"`
}

type GrpcServer

type GrpcServer struct {
	Address  string `yaml:"address"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type HTTPServer

type HTTPServer struct {
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type Node

type Node interface{}

type Program

type Program struct {
	Name                     string            `yaml:"name"`
	Directory                string            `yaml:"directory"`
	Command                  string            `yaml:"command"`
	Environment              env.KeyValues     `yaml:"environment"`
	User                     string            `yaml:"user"`
	ExitCodes                []int             `yaml:"exit_codes" default:"[0,2]"`
	Priority                 int               `yaml:"priority" default:"999"`
	RestartPause             Duration          `yaml:"restart_pause"`
	StartRetries             int               `yaml:"start_retries" default:"3"`
	StartSeconds             Duration          `yaml:"start_seconds" default:"1000000000"`
	Cron                     string            `yaml:"cron"`
	AutoStart                bool              `yaml:"auto_start" default:"true"`
	AutoRestart              *bool             `yaml:"auto_restart"`
	RestartDirectoryMonitor  string            `yaml:"restart_directory_monitor"`
	RestartFilePattern       string            `yaml:"restart_file_pattern" default:"*"`
	RestartWhenBinaryChanged bool              `yaml:"restart_when_binary_changed"`
	StopSignals              []string          `yaml:"stop_signals"`
	StopWaitSeconds          Duration          `yaml:"stop_wait_seconds" default:"10000000000"`
	StopAsGroup              bool              `yaml:"stop_as_group"`
	KillAsGroup              bool              `yaml:"kill_as_group"`
	StdoutLogFile            string            `yaml:"stdout_logfile" default:"/dev/null"`
	StdoutLogfileBackups     int               `yaml:"stdout_logfile_backups" default:"10"`
	StdoutLogFileMaxBytes    int               `yaml:"stdout_logfile_max_bytes" default:"52428800"`
	RedirectStderr           bool              `yaml:"redirect_stderr"`
	StderrLogFile            string            `yaml:"stderr_logfile" default:"/dev/null"`
	StderrLogfileBackups     int               `yaml:"stderr_logfile_backups" default:"10"`
	StderrLogFileMaxBytes    int               `yaml:"stderr_logfile_max_bytes" default:"52428800"`
	DependsOn                []string          `yaml:"depends_on"`
	Labels                   map[string]string `yaml:"labels"`
}

func (*Program) UnmarshalYAML

func (p *Program) UnmarshalYAML(f func(interface{}) error) error

type Reader

type Reader struct{}

func (*Reader) LoadPath

func (r *Reader) LoadPath(path string) (*Root, error)

func (*Reader) LoadReader

func (r *Reader) LoadReader(reader io.Reader) (*Root, error)

func (*Reader) LoadString

func (r *Reader) LoadString(s string) (*Root, error)

func (*Reader) MustLoadString

func (r *Reader) MustLoadString(s string) *Root

type Root

type Root struct {
	Environment env.KeyValues `yaml:"environment"`
	HttpServer  *HTTPServer   `yaml:"http_server"`
	GrpcServer  *GrpcServer   `yaml:"grpc_server"`
	Programs    []*Program    `yaml:"programs"`
	Groups      []*Group      `yaml:"groups"`
	FileSystem  *FileSystem
}

func MustLoadString

func MustLoadString(s string) *Root

type Visitor

type Visitor interface {
	Visit(Node) Visitor
}

type WalkFunc

type WalkFunc func(Node) bool

func (WalkFunc) Visit

func (fn WalkFunc) Visit(node Node) Visitor

Jump to

Keyboard shortcuts

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