Documentation
¶
Index ¶
- func Manifold(config ManifoldConfig) dependency.Manifold
- func NewDiscard(priority Priority, tag string) (io.WriteCloser, error)
- func NewSyslog(priority Priority, tag string) (io.WriteCloser, error)
- func NewWorker(cfg WorkerConfig) (worker.Worker, error)
- type ManifoldConfig
- type NewLogger
- type Priority
- type SysLogger
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency manifold that runs the dbaccessor worker, using the resource names defined in the supplied config.
func NewDiscard ¶
func NewDiscard(priority Priority, tag string) (io.WriteCloser, error)
NewDiscard creates a new WriteCloser that discards all writes and the close is a noop.
func NewSyslog ¶
func NewSyslog(priority Priority, tag string) (io.WriteCloser, error)
NewSyslog creates a new instance of a syslog logger, which sends all logs to directly to the _local_ syslog. Returning a io.WriterCloser, so that we can ensure that the underlying logger can be closed when done.
func NewWorker ¶
func NewWorker(cfg WorkerConfig) (worker.Worker, error)
Types ¶
type ManifoldConfig ¶
type ManifoldConfig struct { NewWorker func(WorkerConfig) (worker.Worker, error) NewLogger NewLogger }
ManifoldConfig defines the names of the manifolds on which a Manifold will depend.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate validates the manifold configuration.
type NewLogger ¶
type NewLogger func(Priority, string) (io.WriteCloser, error)
NewLogger is a factory function to create a new syslog logger.
type SysLogger ¶
type SysLogger interface {
Log([]corelogger.LogRecord) error
}
SysLogger defines an interface for logging log records.
type WorkerConfig ¶
type WorkerConfig struct {
NewLogger NewLogger
}
WorkerConfig encapsulates the configuration options for the dbaccessor worker.
func (*WorkerConfig) Validate ¶
func (c *WorkerConfig) Validate() error
Validate ensures that the config values are valid.