Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInstanceNameDuplicate = errors.New("instance name already registered") ErrInstanceUnknown = errors.New("no such instance registered") )
Functions ¶
This section is empty.
Types ¶
type C ¶
type C struct {
Config GlobalConfig
DefaultLogger *log.Logger
Modules *Registry
Lifetime *LifetimeTracker
}
var Global *C
Global is the default instance while refactoring is in progress.
type EarlyStopModule ¶ added in v0.9.4
type EarlyStopModule interface {
LifetimeModule
EarlyStop() error
}
EarlyStopModule is a LifetimeModule that needs to do some bookkeeping before new server instance starts during reload.
type GlobalConfig ¶
type GlobalConfig struct {
// StateDirectory contains the path to the directory that
// should be used to store any data that should be
// preserved between sessions.
//
// Value of this variable must not change after initialization
// in cmd/maddy/main.go.
StateDirectory string
// RuntimeDirectory contains the path to the directory that
// should be used to store any temporary data.
//
// It should be preferred over os.TempDir, which is
// global and world-readable on most systems, while
// RuntimeDirectory can be dedicated for maddy.
//
// Value of this variable must not change after initialization
// in cmd/maddy/main.go.
RuntimeDirectory string
// LibexecDirectory contains the path to the directory
// where helper binaries should be searched.
//
// Value of this variable must not change after initialization
// in cmd/maddy/main.go.
LibexecDirectory string
}
type LifetimeModule ¶ added in v0.9.4
LifetimeModule is a stateful module that needs to have post-configuration startup and graceful shutdown functionality.
type LifetimeTracker ¶ added in v0.9.4
type LifetimeTracker struct {
// contains filtered or unexported fields
}
func NewLifetime ¶ added in v0.9.4
func NewLifetime(log *log.Logger) *LifetimeTracker
func (*LifetimeTracker) Add ¶ added in v0.9.4
func (lt *LifetimeTracker) Add(mod LifetimeModule)
func (*LifetimeTracker) EarlyStopAll ¶ added in v0.9.4
func (lt *LifetimeTracker) EarlyStopAll() error
func (*LifetimeTracker) ReloadAll ¶ added in v0.9.4
func (lt *LifetimeTracker) ReloadAll() error
func (*LifetimeTracker) StartAll ¶ added in v0.9.4
func (lt *LifetimeTracker) StartAll() error
StartAll calls Start for all registered LifetimeModule instances.
func (*LifetimeTracker) StopAll ¶ added in v0.9.4
func (lt *LifetimeTracker) StopAll() error
StopAll calls Stop for all registered LifetimeModule instances.
type Registry ¶ added in v0.9.4
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶ added in v0.9.4
func (*Registry) NotInitialized ¶ added in v0.9.4
type ReloadModule ¶ added in v0.9.4
Click to show internal directories.
Click to hide internal directories.