depmake

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catch

func Catch(logger zerolog.Logger)

Catch will recover from a panic, designed to be used with Panic().

func Panic

func Panic(msg string, err error)

Panic if err != nil, appending a message. Use this only in main programs.

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

func (m DependencyMaker) DepMongoClient(ctx context.Context, logger zerolog.Logger) mongo.DbClient

DepMongoClient opens a mongo session.

func (DependencyMaker) DepRedisSession

func (m DependencyMaker) DepRedisSession(ctx context.Context, db int, logger zerolog.Logger, cfg config.CanopsisConf) *redismod.Client

DepRedisSession opens a redis session.

Jump to

Keyboard shortcuts

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