Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StopDaemon ¶
StopDaemon send term signal to a daemonized process and reports the status.
Types ¶
type App ¶
type App struct {
// A list of non-blocking or short-lived functions to be executed on
// App.Start.
Functions []func() error
// A function to be executed after receiving SIGINT or SIGTERM.
ShutdownFunc func() error
// Instance of resenje.org/daemon.Daemon.
Daemon *daemon.Daemon
// contains filtered or unexported fields
}
App provides common functionalities of an application, like setting a working directory, logging, putting process in the background aka daemonizing and starting arbitrary functions that provide core logic.
type Options ¶
type Options struct {
// Working directory after daemonizing.
HomeDir string
// Directory for log files. If it is not set, logging will be configured
// to print messages to stderr.
LogDir string
// Log files mode.
LogFileMode os.FileMode
// Log directories mode.
LogDirectoryMode os.FileMode
// LogLevel is the lowest level of log messages that will be logged.
LogLevel logging.Level
// Syslog facility for syslog messages. If it is not set, no logging to
// syslog will be done.
SyslogFacility logging.SyslogFacility
// Syslog tag for sysylog messages.
SyslogTag string
// Syslog named network.
SyslogNetwork string
// Syslog network address.
SyslogAddress string
// AccessLogLevel is the lowest level of HTTP access log messages that will
// be logged.
AccessLogLevel logging.Level
// Syslog facility for syslog messages of HTTP requests. If it is not set,
// no logging to syslog will be done.
AccessSyslogFacility logging.SyslogFacility
// Syslog tag for sysylog messages of HTTP requests.
AccessSyslogTag string
// PackageAccessLogLevel is the lowest level of HTTP access log messages
// that will be logged for package resolutions.
PackageAccessLogLevel logging.Level
// Syslog facility for syslog messages of package resolution requests.
// If it is not set, no logging to syslog will be done.
PackageAccessSyslogFacility logging.SyslogFacility
// Syslog tag for sysylog messages of package resolution requests.
PackageAccessSyslogTag string
// Is logging of audit messages completely disabled.
AuditLogDisabled bool
// Syslog facility for syslog audit messages. If it is not set,
// no logging to syslog will be done.
AuditSyslogFacility logging.SyslogFacility
// Syslog tag for sysylog audit messages.
AuditSyslogTag string
// If LogDir is set, but there is need to force logging to stderr,
// ForceLogToStderr should be set to true.
ForceLogToStderr bool
// File name of a PID file.
PidFileName string
// Mode of a PID file. Default 644.
PidFileMode os.FileMode
// File name in which to redirect stdout and stderr of a daemonized process.
// If it is not set, /dev/null will be used.
DaemonLogFileName string
// Mode of a daemon log file. Default 644.
DaemonLogFileMode os.FileMode
}
Options contain optional parameters for App.
Click to show internal directories.
Click to hide internal directories.