Versions in this module Expand all Collapse all v0 v0.1.0 Apr 10, 2025 Changes in this version + var ErrKafkaNotInitialized = errors.New("kafka service not initialized") + var ErrRabbitMQNotInitialized = errors.New("RabbitMQ service not initialized") + func GetTx(ctx context.Context) (*sql.Tx, error) + type ContextKey string + const ContextKeyTransaction + type Data struct + Conn *connection2.Connections + Kafka *kafka.Kafka + RabbitMQ *rabbitmq.RabbitMQ + func New(cfg *config.Config, createNewInstance ...bool) (*Data, func(name ...string), error) + func (d *Data) Close() []error + func (d *Data) ConsumeFromKafka(ctx context.Context, topic, groupID string, handler func([]byte) error) error + func (d *Data) ConsumeFromRabbitMQ(queue string, handler func([]byte) error) error + func (d *Data) DB() *sql.DB + func (d *Data) DBRead() (*sql.DB, error) + func (d *Data) GetDBManager() *connection2.DBManager + func (d *Data) GetElasticsearch() *elastic.Client + func (d *Data) GetMeilisearch() *meili.Client + func (d *Data) GetMongoManager() *connection2.MongoManager + func (d *Data) GetRedis() *redis.Client + func (d *Data) Ping(ctx context.Context) error + func (d *Data) PublishToKafka(ctx context.Context, topic string, key, value []byte) error + func (d *Data) PublishToRabbitMQ(exchange, routingKey string, body []byte) error + func (d *Data) WithTx(ctx context.Context, fn func(ctx context.Context) error) error + func (d *Data) WithTxRead(ctx context.Context, fn func(ctx context.Context) error) error + type Option func(*Data)