database

package
v0.0.0-...-0e2b64a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func NewPostgresConnection

func NewPostgresConnection(config PostgresConfig) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

type PostgresConfig

type PostgresConfig struct {
	URL          string        `mapstructure:"DB_URL"`
	MaxOpenConns int           `mapstructure:"DB_MAX_OPEN_CONNS"`
	MaxIdleConns int           `mapstructure:"DB_MAX_IDLE_CONNS"`
	MaxLifetime  time.Duration `mapstructure:"DB_MAX_LIFETIME"`
}

func LoadPostgresConfig

func LoadPostgresConfig() (PostgresConfig, error)

type RedisClient

type RedisClient struct {
	*redis.Client
}

func NewRedisConnection

func NewRedisConnection(config RedisConfig) (*RedisClient, error)

func (*RedisClient) Close

func (r *RedisClient) Close() error

type RedisConfig

type RedisConfig struct {
	URL      string `mapstructure:"REDIS_URL"`
	PoolSize int    `mapstructure:"REDIS_POOL_SIZE"`
}

func LoadRedisConfig

func LoadRedisConfig() (RedisConfig, error)

Jump to

Keyboard shortcuts

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