Documentation ¶
Index ¶
- func Catch(logger zerolog.Logger)
- func Panic(msg string, err error)
- type DependencyMaker
- func (m DependencyMaker) DepAMQPChannelPub(session libamqp.Connection) libamqp.Channel
- func (m DependencyMaker) DepAMQPChannelSub(session libamqp.Connection, prefetchCount, prefetchSize int) libamqp.Channel
- func (m DependencyMaker) DepAmqpConnection(logger zerolog.Logger, cfg config.CanopsisConf) libamqp.Connection
- func (m DependencyMaker) DepConfig(ctx context.Context, dbClient mongo.DbClient) config.CanopsisConf
- func (m DependencyMaker) DepMongoClient(ctx context.Context, logger zerolog.Logger) mongo.DbClient
- func (m DependencyMaker) DepRedisSession(ctx context.Context, db int, logger zerolog.Logger, cfg config.CanopsisConf) *redismod.Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Catch ¶
Catch will recover from a panic, designed to be used with Panic().
Types ¶
type DependencyMaker ¶
type DependencyMaker struct { }
DependencyMaker is just a handling struct and can be initialized empty. DO NOT use this type in any other place than a main package with a main() func, under any circumstances.
Every single function available MUST call depmake.Panic() instead of managing manually the error.
The idea behind that is simple: what you can't get makes you stop right now.
func (DependencyMaker) DepAMQPChannelPub ¶
func (m DependencyMaker) DepAMQPChannelPub(session libamqp.Connection) libamqp.Channel
DepAMQPChannelPub opens a channel from a given session, to be used for publishing messages.
func (DependencyMaker) DepAMQPChannelSub ¶
func (m DependencyMaker) DepAMQPChannelSub(session libamqp.Connection, prefetchCount, prefetchSize int) libamqp.Channel
DepAMQPChannelSub opens a channel from a given session, and apply Qos on it.
func (DependencyMaker) DepAmqpConnection ¶
func (m DependencyMaker) DepAmqpConnection(logger zerolog.Logger, cfg config.CanopsisConf) libamqp.Connection
DepAmqpConnection opens an amqp session.
func (DependencyMaker) DepConfig ¶
func (m DependencyMaker) DepConfig(ctx context.Context, dbClient mongo.DbClient) config.CanopsisConf
DepConfig gets a config from mongodb
func (DependencyMaker) DepMongoClient ¶
DepMongoClient opens a mongo session.