Documentation ¶
Index ¶
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 a log sink worker, using the resource names defined in the supplied config.
func NewModelLogger ¶
func NewModelLogger( loggerForModelFunc corelogger.LogWriterForModelFunc, bufferSize int, flushInterval time.Duration, clock clock.Clock, ) corelogger.ModelLogger
NewModelLogger returns a new model logger instance. The actual loggers returned for each model are created by the supplied loggerForModelFunc.
Types ¶
type Config ¶
type Config struct { Logger logger.Logger Clock clock.Clock LogSinkConfig LogSinkConfig LogWriterForModelFunc logger.LogWriterForModelFunc }
Config defines the attributes used to create a log sink worker.
type LogSink ¶
type LogSink struct {
// contains filtered or unexported fields
}
LogSink is a worker which provides access to a log sink which allows log entries to be stored for specified models.
type LogSinkConfig ¶
type LogSinkConfig struct { // LoggerBufferSize is the capacity of the log sink logger's buffer. LoggerBufferSize int // LoggerFlushInterval is the amount of time to allow a log record // to sit in the buffer before being flushed to the destination logger. LoggerFlushInterval time.Duration }
LogSinkConfig holds parameters to control the log sink's behaviour.
func DefaultLogSinkConfig ¶
func DefaultLogSinkConfig() LogSinkConfig
DefaultLogSinkConfig returns a LogSinkConfig with default values.
func (LogSinkConfig) Validate ¶
func (cfg LogSinkConfig) Validate() error
Validate validates the logsink endpoint configuration.
type ManifoldConfig ¶
type ManifoldConfig struct { // DebugLogger is used to emit debug messages. DebugLogger logger.Logger // NewWorker creates a log sink worker. NewWorker func(cfg Config) (worker.Worker, error) ClockName string DomainServicesName string AgentName string }
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.