interfaces

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package interfaces provides database interfaces for the db package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClientInterface

type MongoClientInterface interface {
	Ping(ctx context.Context, rp *readpref.ReadPref) error
	Connect(ctx context.Context) error
	Database(name string, opts ...*options.DatabaseOptions) *mongo.Database
}

MongoClientInterface defines the interface for mongo.Client operations

type PgxPoolInterface

type PgxPoolInterface interface {
	Ping(ctx context.Context) error
	Begin(ctx context.Context) (pgx.Tx, error)
	Close()
}

PgxPoolInterface defines the interface for pgxpool.Pool operations

type PgxTxInterface

type PgxTxInterface interface {
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
}

PgxTxInterface defines the interface for pgx.Tx operations

type SQLDBInterface

type SQLDBInterface interface {
	PingContext(ctx context.Context) error
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
	SetMaxOpenConns(n int)
	SetMaxIdleConns(n int)
	SetConnMaxLifetime(d time.Duration)
}

SQLDBInterface defines the interface for sql.DB operations

type SQLTxInterface

type SQLTxInterface interface {
	Commit() error
	Rollback() error
}

SQLTxInterface defines the interface for sql.Tx operations

Jump to

Keyboard shortcuts

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