Documentation
¶
Index ¶
Constants ¶
View Source
const ( // EscalationInterval is used as the default value when none is given to // service.Stop() as the time to wait before increasing urgency of signal EscalationInterval = 10 * time.Second )
Variables ¶
View Source
var ( // Version of the package Version = semver.MustParse("0.1.0-alpha.2.2") // ServiceConfigFile is the full path to the config file that lists // services to be read on server startup. If the path doesn't exist, // this'll be empty. ServiceConfigFile string // LogLevel determines the severity of messages that are logged. LogLevel = log.LvlWarn // LogPath is the path to the server's log file. LogPath = "bento.log" // FifoPath is the path to a unix named pipe that's used to communicate // between clients & the server. FifoPath = ".fifo" // HeartbeatInterval is the frequency that the fifo file is touched to // indicate a live server. HeartbeatInterval = 10 * time.Second // CleanTempServicesAfter is the interval after which an exited temp // service is removed. CleanTempServicesAfter = 1 * time.Hour )
Functions ¶
Types ¶
type ConfFormat ¶
type ConfFormat struct {
LogLevel string `yaml:"log_level"`
LogPath string `yaml:"log"`
FifoPath string `yaml:"fifo"`
CleanTempServicesAfter string `yaml:"clean_temp_services_after"`
}
ConfFormat is the yaml definition of the config file
type Service ¶
type Service struct {
Name string `yaml:"name"`
// What to run
Program string `yaml:"program"`
Args []string `yaml:"args,omitempty"`
// Runtime env
Dir string `yaml:"dir,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
// Behavior
AutoStart bool `yaml:"auto-start,omitempty"`
RestartOnExit bool `yaml:"restart-on-exit,omitempty"`
// Temp is true if this config isn't loaded from a file, created at runtime
Temp bool `yaml:",omitempty"`
CleanAfter time.Duration `yaml:",omitempty"`
}
Service is the settings a service is made from
func LoadServiceFile ¶
LoadServiceFile reads a file for a list of service confs, sanitizing them all
func (*Service) EqualIgnoringSafeFields ¶
EqualIgnoringSafeFields returns true if the service config equals another, ignoring fields that can be safely changed on a running service.
type ServiceByName ¶
type ServiceByName []Service
ServiceByName implements the sort interface
func (ServiceByName) Len ¶
func (i ServiceByName) Len() int
func (ServiceByName) Less ¶
func (i ServiceByName) Less(a, b int) bool
func (ServiceByName) Swap ¶
func (i ServiceByName) Swap(a, b int)
Click to show internal directories.
Click to hide internal directories.