config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	G = &Config{}
)

Functions

func Init

func Init()

Types

type Config

type Config struct {
	SupConfig     Sup     `toml:"sup" comment:"Config related with Sup."`
	ProgramConfig Program `toml:"program" comment:"Config related with the supervised process."`
}

type Log

type Log struct {
	Path            string `toml:"path" comment:"Path where to save the current un-rotated log. Using basename of the supervised process by default."`
	MaxSize         int    `toml:"maxSize" comment:"Maximum size in MiB of the log file before it gets rotated. 128 MiB by default." default:"134217728"`
	MaxDays         int    `` /* 144-byte string literal not displayed */
	MaxBackups      int    `` /* 138-byte string literal not displayed */
	Compress        bool   `` /* 130-byte string literal not displayed */
	MergeCompressed bool   `toml:"mergeCompressed" comment:"Whether the gzipped backups should be merged, no by default." default:"false"`
}

type Process

type Process struct {
	Path            string                 `toml:"path" comment:"Path to an executable, which would spawn the supervised process."`
	Args            []string               `toml:"args" comment:"Arguments to the supervised process."`
	Envs            map[string]string      `toml:"envs" comment:"Environment variables to the supervised process."`
	WorkDir         string                 `toml:"workDir" comment:"Working directory of the supervised process. Current directory by default." default:"./"`
	AutoStart       bool                   `toml:"autoStart" comment:"Start the process as Sup goes up. False by default." default:"false"`
	StartSeconds    int                    `` /* 126-byte string literal not displayed */
	RestartStrategy ProcessRestartStrategy `` /* 169-byte string literal not displayed */
}

type ProcessRestartStrategy

type ProcessRestartStrategy string

How to react when the supervised process went down.

const (
	RestartStrategyAlways    ProcessRestartStrategy = "always"
	RestartStrategyOnFailure ProcessRestartStrategy = "on-failure"
	RestartStrategyNone      ProcessRestartStrategy = "none"
)

type Program

type Program struct {
	Process Process `toml:"process" comment:"Config related with process."`
	Log     Log     `toml:"log" comment:"Config related with log."`
}

type Sup

type Sup struct {
	Socket string `toml:"socket" comment:"Path to an unix socket, to which Sup daemon will be listening." default:"./sup.sock"`
}

Jump to

Keyboard shortcuts

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