Documentation ¶
Overview ¶
Watermill is a Golang library for working efficiently with message streams.
It is intended for building event driven applications, enabling event sourcing, RPC over messages, sagas and basically whatever else comes to your mind.
You can use conventional pub/sub implementations like Kafka or RabbitMQ, but also HTTP or MySQL binlog if that fits your use case.
Website with detailed documentation: https://watermill.io/
Getting started guide: https://watermill.io/docs/getting-started/
Index ¶
- func NewShortUUID() string
- func NewULID() string
- func NewUUID() string
- type CaptureLoggerAdapter
- func (c *CaptureLoggerAdapter) Captured() map[LogLevel][]CapturedMessage
- func (c *CaptureLoggerAdapter) Debug(msg string, fields LogFields)
- func (c *CaptureLoggerAdapter) Error(msg string, err error, fields LogFields)
- func (c *CaptureLoggerAdapter) Has(msg CapturedMessage) bool
- func (c *CaptureLoggerAdapter) HasError(err error) bool
- func (c *CaptureLoggerAdapter) Info(msg string, fields LogFields)
- func (c *CaptureLoggerAdapter) Trace(msg string, fields LogFields)
- func (c *CaptureLoggerAdapter) With(fields LogFields) LoggerAdapter
- type CapturedMessage
- type LogFields
- type LogLevel
- type LoggerAdapter
- type NopLogger
- type StdLoggerAdapter
- func (l *StdLoggerAdapter) Debug(msg string, fields LogFields)
- func (l *StdLoggerAdapter) Error(msg string, err error, fields LogFields)
- func (l *StdLoggerAdapter) Info(msg string, fields LogFields)
- func (l *StdLoggerAdapter) Trace(msg string, fields LogFields)
- func (l *StdLoggerAdapter) With(fields LogFields) LoggerAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewShortUUID ¶ added in v1.3.0
func NewShortUUID() string
Types ¶
type CaptureLoggerAdapter ¶ added in v1.3.0
type CaptureLoggerAdapter struct {
// contains filtered or unexported fields
}
CaptureLoggerAdapter is a logger which captures all logs. This logger is mostly useful for testing logging.
func NewCaptureLogger ¶ added in v1.3.0
func NewCaptureLogger() *CaptureLoggerAdapter
func (*CaptureLoggerAdapter) Captured ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Captured() map[LogLevel][]CapturedMessage
func (*CaptureLoggerAdapter) Debug ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Debug(msg string, fields LogFields)
func (*CaptureLoggerAdapter) Error ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Error(msg string, err error, fields LogFields)
func (*CaptureLoggerAdapter) Has ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Has(msg CapturedMessage) bool
func (*CaptureLoggerAdapter) HasError ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) HasError(err error) bool
func (*CaptureLoggerAdapter) Info ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Info(msg string, fields LogFields)
func (*CaptureLoggerAdapter) Trace ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) Trace(msg string, fields LogFields)
func (*CaptureLoggerAdapter) With ¶ added in v1.3.0
func (c *CaptureLoggerAdapter) With(fields LogFields) LoggerAdapter
type CapturedMessage ¶ added in v1.3.0
type LoggerAdapter ¶
type LoggerAdapter interface { Error(msg string, err error, fields LogFields) Info(msg string, fields LogFields) Debug(msg string, fields LogFields) Trace(msg string, fields LogFields) With(fields LogFields) LoggerAdapter }
LoggerAdapter is an interface, that you need to implement to support Watermill logging. You can use StdLoggerAdapter as a reference implementation.
func NewStdLogger ¶
func NewStdLogger(debug, trace bool) LoggerAdapter
NewStdLogger creates StdLoggerAdapter which sends al logs to stderr.
func NewStdLoggerWithOut ¶ added in v1.3.0
func NewStdLoggerWithOut(out io.Writer, debug bool, trace bool) LoggerAdapter
NewStdLoggerWithOut creates StdLoggerAdapter which sends all logs to provided io.Writer.
type NopLogger ¶
type NopLogger struct{}
NopLogger is a logger which discards all logs.
func (NopLogger) With ¶ added in v1.3.0
func (l NopLogger) With(fields LogFields) LoggerAdapter
type StdLoggerAdapter ¶
type StdLoggerAdapter struct { ErrorLogger *log.Logger InfoLogger *log.Logger DebugLogger *log.Logger TraceLogger *log.Logger // contains filtered or unexported fields }
StdLoggerAdapter is a logger implementation, which sends al logs to provided standard output.
func (*StdLoggerAdapter) Debug ¶
func (l *StdLoggerAdapter) Debug(msg string, fields LogFields)
func (*StdLoggerAdapter) Error ¶
func (l *StdLoggerAdapter) Error(msg string, err error, fields LogFields)
func (*StdLoggerAdapter) Info ¶
func (l *StdLoggerAdapter) Info(msg string, fields LogFields)
func (*StdLoggerAdapter) Trace ¶
func (l *StdLoggerAdapter) Trace(msg string, fields LogFields)
func (*StdLoggerAdapter) With ¶ added in v1.3.0
func (l *StdLoggerAdapter) With(fields LogFields) LoggerAdapter
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
components
|
|
dev
|
|
update-examples-deps
Module
|
|
validate-examples
Module
|
|
docs
|
|
tools
|
|
mill
Module
|