Documentation
¶
Index ¶
- func GetLogger() *slog.Logger
- func InitLogger(format LogFormat)
- func LogDebug(msg string, args ...any)
- func LogError(msg string, args ...any)
- func LogInfo(msg string, args ...any)
- func LogWarn(msg string, args ...any)
- func SigFromName(n string) os.Signal
- type Config
- type LogFormat
- type Starter
- type WorkerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLogger ¶
func InitLogger(format LogFormat)
InitLogger initializes the global logger with the specified format
func SigFromName ¶
SigFromName returns the signal corresponding to the given signal name string. If the given name string is not defined, it returns nil.
Types ¶
type Config ¶
type Config interface {
Args() []string
Command() string
Dir() string // Directory to chdir to before executing the command
Interval() time.Duration // Time between checks for liveness
PidFile() string
Ports() []string // Ports to bind to (addr:port or port, so it's a string)
Paths() []string // Paths (UNIX domain socket) to bind to
SignalOnHUP() os.Signal // Signal to send when HUP is received
SignalOnTERM() os.Signal // Signal to send when TERM is received
StatusFile() string
LogFormat() string // Log output format (text or json)
}
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
func NewStarter ¶
NewStarter creates a new Starter object. Config parameter may NOT be nil, as `Ports` and/or `Paths`, and `Command` are required
func (*Starter) StartWorker ¶
StartWorker starts the actual command.
Click to show internal directories.
Click to hide internal directories.
