Documentation ¶
Index ¶
- Constants
- Variables
- func GetUidFromGrpcCtx(ctx context.Context, header string, logger *zap.Logger) (int32, error)
- func GetUidFromHttpRequest(r *http.Request, header string, logger *zap.Logger) (int32, error)
- func NewMongoDBConn(uri, database string) (*mongo.Database, error)
- type EventHandler
- type RabbitMqEventBus
Constants ¶
View Source
const ( EventKindCreated = "created" EventKindDeleted = "deleted" ExchangeType = "fanout" )
Variables ¶
View Source
var ( ErrUnknown = errors.New("E001") ErrNotFound = errors.New("E002") ErrNotAvailable = errors.New("E003") ErrInvalidToken = errors.New("E005") ErrInvalidFormat = errors.New("E006") ErrInvalidHeader = errors.New("E007") ErrAlreadyExists = errors.New("E010") ErrChannelClosed = errors.New("channel closed") ErrProtectedContent = errors.New("protected content") ErrUnidentified = errors.New("unidentified") )
Functions ¶
func GetUidFromGrpcCtx ¶
func GetUidFromHttpRequest ¶
Types ¶
type EventHandler ¶
type RabbitMqEventBus ¶
type RabbitMqEventBus struct {
// contains filtered or unexported fields
}
func NewRabbitMqEventBus ¶
func NewRabbitMqEventBus(chann *amqp.Channel, logger *zap.Logger) *RabbitMqEventBus
func (*RabbitMqEventBus) Chann ¶
func (bus *RabbitMqEventBus) Chann() *amqp.Channel
func (*RabbitMqEventBus) Consume ¶
func (bus *RabbitMqEventBus) Consume(ctx context.Context, queue string, handler EventHandler) error
func (*RabbitMqEventBus) QueueBind ¶
func (bus *RabbitMqEventBus) QueueBind(exchange, queue string) error
Click to show internal directories.
Click to hide internal directories.