libmq

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewMQ)

Functions

This section is empty.

Types

type MQ

type MQ struct {
	// contains filtered or unexported fields
}

func NewMQ

func NewMQ() (*MQ, func(), error)

func (*MQ) Publish

func (a *MQ) Publish(ctx context.Context, topic string, payload []byte) error

func (*MQ) RegisterTopic

func (a *MQ) RegisterTopic(topic Topic) error

func (*MQ) Start

func (a *MQ) Start(ctx context.Context) error

func (*MQ) Stop

func (a *MQ) Stop(ctx context.Context) error

type MQLogger added in v0.0.5

type MQLogger struct {
	// contains filtered or unexported fields
}

func (*MQLogger) Debug added in v0.0.5

func (l *MQLogger) Debug(msg string, fields watermill.LogFields)

func (*MQLogger) Error added in v0.0.5

func (l *MQLogger) Error(msg string, err error, fields watermill.LogFields)

func (*MQLogger) Info added in v0.0.5

func (l *MQLogger) Info(msg string, fields watermill.LogFields)

func (*MQLogger) Trace added in v0.0.5

func (l *MQLogger) Trace(msg string, fields watermill.LogFields)

func (*MQLogger) With added in v0.0.5

type Topic

type Topic interface {
	Name() string
	Consume(context.Context, []byte) error
	SetMQ(*MQ)
}

type TopicImpl

type TopicImpl[T any] struct {
	// contains filtered or unexported fields
}

func NewTopic

func NewTopic[T any](topic string, payloadFunc func() T, consumerFunc func(context.Context, T) error) *TopicImpl[T]

func (*TopicImpl[T]) Consume

func (t *TopicImpl[T]) Consume(ctx context.Context, i []byte) error

func (*TopicImpl[T]) Name

func (t *TopicImpl[T]) Name() string

func (*TopicImpl[T]) Payload

func (t *TopicImpl[T]) Payload() T

func (*TopicImpl[T]) Publish

func (t *TopicImpl[T]) Publish(ctx context.Context, i T) error

func (*TopicImpl[T]) SetMQ

func (t *TopicImpl[T]) SetMQ(mq *MQ)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL