conns

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = types.Module{
	{CreateFunc: NewConns},
}.
	Append(postrgres.Module).
	Append(elastic.Module).
	Append(kafka.Module).
	Append(couchbase.Module)

Functions

This section is empty.

Types

type Conns

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

func NewConns

func NewConns(
	logger *zap.Logger,
	elastic *elasticsearch.Client,
	elasticConn *elastic.ElasticConn,
	sqlxPoolDB map[string]*sqlx.DB,
	pgxPoolDB map[string]*pgxpool.Pool,
	sqlConns map[string]connectors.DBConnector[*sqlx.DB, *sqlx.Tx],
	goquConns map[string]connectors.DBConnector[*goqu.Database, *goqu.TxDatabase],
	pgxConns map[string]connectors.DBConnector[dbtypes.PgxConn, dbtypes.PgxTx],
	kafka *kafka.Kafka,
	couchbase *couchbase.Couchbase,
) *Conns

func (*Conns) Close

func (c *Conns) Close()

func (*Conns) GetCouchbase added in v1.0.23

func (c *Conns) GetCouchbase() (*couchbase.Couchbase, error)

GetCouchbase возвращает абстракцию над коучбейсом

func (*Conns) GetDB deprecated

func (c *Conns) GetDB() (*sqlx.DB, error)

Deprecated: Use GetSQLConnByName instead

func (*Conns) GetElastic

func (c *Conns) GetElastic() (*elasticsearch.Client, error)

GetElastic возвращает клиент для работы с эластиком Deprecated: Use GetElasticConn instead

func (*Conns) GetElasticConn added in v1.0.23

func (c *Conns) GetElasticConn() (*elastic.ElasticConn, error)

func (*Conns) GetGoQuConn

func (c *Conns) GetGoQuConn(nameConn string) (connectors.DBConnector[*goqu.Database, *goqu.TxDatabase], error)

GetGoQuConn создает слой sql-builder'а для конструирования запросов в БД. Также он умеет делать scan в структуры

func (*Conns) GetKafka added in v1.0.9

func (c *Conns) GetKafka() (*kafka.Kafka, error)

GetKafka возвращает абстракцию над кафкой

func (*Conns) GetPGXConnByName added in v1.0.7

func (c *Conns) GetPGXConnByName(nameConn string) (connectors.DBConnector[dbtypes.PgxConn, dbtypes.PgxTx], error)

GetPGXConnByName возвращает коннект к бд, если он есть

func (*Conns) GetSQLConn deprecated

func (c *Conns) GetSQLConn() (connectors.DBConnector[*sqlx.DB, *sqlx.Tx], error)

Deprecated: Use GetSQLConnByName instead

func (*Conns) GetSQLConnByName added in v1.0.1

func (c *Conns) GetSQLConnByName(nameConn string) (connectors.DBConnector[*sqlx.DB, *sqlx.Tx], error)

GetSQLConnByName возвращает коннект к бд, если он есть

Jump to

Keyboard shortcuts

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