Documentation ¶
Overview ¶
Package watermill fork from github.com/ThreeDotsLabs/watermill@v1.3.5
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 ¶
- Constants
- 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 ¶
const ( ContextKeyMessageUUID = "watermill:message_uuid" ContextKeyRawMessageID = "watermill:raw_message_id" ContextLogFieldKey = "watermill:context" MessageRouterAck = "watermill:router_ack" MessageHeaderAppID = "appid" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptureLoggerAdapter ¶
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 ¶
func NewCaptureLogger() *CaptureLoggerAdapter
func (*CaptureLoggerAdapter) Captured ¶
func (c *CaptureLoggerAdapter) Captured() map[LogLevel][]CapturedMessage
func (*CaptureLoggerAdapter) Debug ¶
func (c *CaptureLoggerAdapter) Debug(msg string, fields LogFields)
func (*CaptureLoggerAdapter) Error ¶
func (c *CaptureLoggerAdapter) Error(msg string, err error, fields LogFields)
func (*CaptureLoggerAdapter) Has ¶
func (c *CaptureLoggerAdapter) Has(msg CapturedMessage) bool
func (*CaptureLoggerAdapter) HasError ¶
func (c *CaptureLoggerAdapter) HasError(err error) bool
func (*CaptureLoggerAdapter) Info ¶
func (c *CaptureLoggerAdapter) Info(msg string, fields LogFields)
func (*CaptureLoggerAdapter) Trace ¶
func (c *CaptureLoggerAdapter) Trace(msg string, fields LogFields)
func (*CaptureLoggerAdapter) With ¶
func (c *CaptureLoggerAdapter) With(fields LogFields) LoggerAdapter
type CapturedMessage ¶
type LogFields ¶
LogFields is the logger's key-value list of fields.
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 all logs to stderr.
func NewStdLoggerWithOut ¶
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 ¶
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 all 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 ¶
func (l *StdLoggerAdapter) With(fields LogFields) LoggerAdapter
Directories ¶
Path | Synopsis |
---|---|
components
|
|
amqp
Package amqp fork from github.com/ThreeDotsLabs/watermill-amqp@f72ea40 AMQP implementation of Watermill's Pub/Sub interface.
|
Package amqp fork from github.com/ThreeDotsLabs/watermill-amqp@f72ea40 AMQP implementation of Watermill's Pub/Sub interface. |
io
Package io fork from github.com/ThreeDotsLabs/watermill-io@c24ff9d
|
Package io fork from github.com/ThreeDotsLabs/watermill-io@c24ff9d |
kafka
Package kafka fork from github.com/ThreeDotsLabs/watermill-kafka@v2.5.0
|
Package kafka fork from github.com/ThreeDotsLabs/watermill-kafka@v2.5.0 |
pulsar
Package pulsar fork from github.com/AlexCuse/watermill-pulsar@f5e8591
|
Package pulsar fork from github.com/AlexCuse/watermill-pulsar@f5e8591 |
redis
Package redis fork from github.com/ThreeDotsLabs/watermill-redisstream@v1.2.2
|
Package redis fork from github.com/ThreeDotsLabs/watermill-redisstream@v1.2.2 |
rocketmq
Package rocketmq fork from github.com/yflau/watermill-rocketmq@ea447b0
|
Package rocketmq fork from github.com/yflau/watermill-rocketmq@ea447b0 |