Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultFileMode os.FileMode = 0666 DefaultDirectoryMode os.FileMode = 0777 DefaultDaemonLogFileName = "daemon.log" )
Package default variables.
View Source
var NewConfig = config.New
NewConfig creates a new instance of Config.
Deprecated: Use resenje.org/x/config.New.
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 and putting process in the background aka daemonizing and starting arbitrary functions that provide core logic.
type AppOptions ¶
type AppOptions struct {
// Working directory after daemonizing.
HomeDir string
// Directory for log files. If it is not set, logger will be configured
// to print messages to stderr.
LogDir string
// 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
}
AppOptions contain optional parameters for App.
type EmailOptions ¶
type EmailOptions struct {
NotifyAddresses []string `json:"notify-addresses" yaml:"notify-addresses" envconfig:"NOTIFY_ADDRESS"`
DefaultFrom string `json:"default-from" yaml:"default-from" envconfig:"DEFAULT_FROM"`
SubjectPrefix string `json:"subject-prefix" yaml:"subject-prefix" envconfig:"SUBJECT_PREFIX"`
SMTPIdentity string `json:"smtp-identity" yaml:"smtp-identity" envconfig:"SMTP_IDENTITY"`
SMTPUsername string `json:"smtp-username" yaml:"smtp-username" envconfig:"SMTP_USERNAME"`
SMTPPassword string `json:"smtp-password" yaml:"smtp-password" envconfig:"SMTP_PASSWORD"`
SMTPHost string `json:"smtp-host" yaml:"smtp-host" envconfig:"SMTP_HOST"`
SMTPPort int `json:"smtp-port" yaml:"smtp-port" envconfig:"SMTP_PORT"`
SMTPSkipVerify bool `json:"smtp-skip-verify" yaml:"smtp-skip-verify" envconfig:"SMTP_SKIP_VERIFY"`
// contains filtered or unexported fields
}
EmailOptions defines parameters for email sending.
func NewEmailOptions ¶
func NewEmailOptions(name string) *EmailOptions
NewEmailOptions initializes EmailOptions with default values.
func (*EmailOptions) VerifyAndPrepare ¶
func (o *EmailOptions) VerifyAndPrepare() error
VerifyAndPrepare implements application.Options interface.
Click to show internal directories.
Click to hide internal directories.