Documentation
¶
Index ¶
- Variables
- func HandleError(ctx context.Context, errCh <-chan error, handler ErrorHandler)
- type Bus
- type Error
- type ErrorHandler
- type Event
- type Handler
- type HandlerFunc
- type MetricsBus
- type Middleware
- type Option
- type PublishOption
- func WithApprox(approx bool) PublishOption
- func WithApproxMaxLen(maxLen int64) PublishOption
- func WithID(id string) PublishOption
- func WithLimit(limit int64) PublishOption
- func WithMaxLen(maxLen int64) PublishOption
- func WithMinID(minID string) PublishOption
- func WithValues(values map[string]interface{}) PublishOption
- type Publisher
- type RedisBus
- func (b *RedisBus) Errors() <-chan error
- func (b *RedisBus) Middleware(middlewares ...Middleware)
- func (b *RedisBus) Publish(ctx context.Context, event Event) error
- func (b *RedisBus) Stop(ctx context.Context) error
- func (b *RedisBus) Subscribe(ctx context.Context, name string, handler Handler) error
- type Subscriber
- type TracingBus
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func HandleError ¶
func HandleError(ctx context.Context, errCh <-chan error, handler ErrorHandler)
Types ¶
type Bus ¶
type Bus interface { Publisher Subscriber }
type Error ¶
type Error struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Group string `json:"group,omitempty"` Consumer string `json:"consumer,omitempty"` Err error `json:"error,omitempty"` EventID uuid.UUID `json:"event_id,omitempty"` EventDate time.Time `json:"event_date,omitempty"` }
type ErrorHandler ¶
type HandlerFunc ¶
type MetricsBus ¶
type MetricsBus struct { Bus // contains filtered or unexported fields }
func NewMetricsBus ¶
func NewMetricsBus(inner Bus) (*MetricsBus, error)
type Middleware ¶
type Option ¶
type Option func(b *RedisBus)
func WithClientID ¶
func WithLogError ¶
func WithPublishOption ¶
func WithPublishOption(options ...PublishOption) Option
type PublishOption ¶
type PublishOption func(a *addArgs)
func WithApprox ¶
func WithApprox(approx bool) PublishOption
func WithApproxMaxLen ¶
func WithApproxMaxLen(maxLen int64) PublishOption
func WithID ¶
func WithID(id string) PublishOption
func WithLimit ¶
func WithLimit(limit int64) PublishOption
func WithMaxLen ¶
func WithMaxLen(maxLen int64) PublishOption
func WithMinID ¶
func WithMinID(minID string) PublishOption
func WithValues ¶
func WithValues(values map[string]interface{}) PublishOption
type RedisBus ¶
type RedisBus struct {
// contains filtered or unexported fields
}
func NewRedisBus ¶
func (*RedisBus) Middleware ¶
func (b *RedisBus) Middleware(middlewares ...Middleware)
type Subscriber ¶
type TracingBus ¶
type TracingBus struct { Bus // contains filtered or unexported fields }
func NewTracingBus ¶
func NewTracingBus(inner Bus) *TracingBus
Click to show internal directories.
Click to hide internal directories.