database

package
v0.0.0-...-cd7fc74 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoConfig

type MongoConfig struct {
	Host     string
	Port     int64
	Username string
	Password string
	Name     string
}

type MongoDatabase

type MongoDatabase struct {
	*mongo.Database
	// contains filtered or unexported fields
}

func NewMongoDatabase

func NewMongoDatabase(cfg *MongoConfig) (*MongoDatabase, error)

func (*MongoDatabase) Connect

func (d *MongoDatabase) Connect(_ context.Context) error

func (*MongoDatabase) Disconnect

func (d *MongoDatabase) Disconnect(ctx context.Context) error

type PostgresConfig

type PostgresConfig struct {
	Host                   string
	Port                   int64
	Username               string
	Password               string
	Name                   string
	MaxConns               int64
	MaxConnIdleTimeMinutes int64
}

type PostgresDatabase

type PostgresDatabase struct {
	*pgxpool.Pool
	// contains filtered or unexported fields
}

func NewPostgresDatabase

func NewPostgresDatabase(cfg *PostgresConfig) (*PostgresDatabase, error)

func (*PostgresDatabase) Connect

func (d *PostgresDatabase) Connect(ctx context.Context) error

func (*PostgresDatabase) Disconnect

func (d *PostgresDatabase) Disconnect(_ context.Context) error

Jump to

Keyboard shortcuts

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