connections

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnWrapper

type ConnWrapper struct {
	*gormpager.GormPager
}

func GetGormConnection

func GetGormConnection(config DatabaseConnectionConfig) *ConnWrapper

func (*ConnWrapper) ServiceHealth

func (c *ConnWrapper) ServiceHealth() (httphealthcheck.HealthStatusData, error)

func (*ConnWrapper) ServiceName

func (c *ConnWrapper) ServiceName() string

type DatabaseConnectionConfig

type DatabaseConnectionConfig struct {
	Dns          string `env:"DATABASE_URL" validate:"required|isURL"`
	MaxIdleConns int    `env:"DB_MAX_IDLE_CONNS" envDefault:"1" validate:"required"`
	MaxOpenConns int    `env:"DB_MAX_OPEN_CONNS" envDefault:"1" validate:"required"`
	MinPageSize  uint   `env:"MIN_PAGE_SIZE" envDefault:"1" validate:"required"`
	MaxPageSize  uint   `env:"MAX_PAGE_SIZE" envDefault:"100" validate:"required"`
}

type RedisConfig

type RedisConfig struct {
	Dns string `env:"REDIS_URL" validate:"required|isURL"`
}

type RedisWrapper

type RedisWrapper struct {
	*redis.Client
}

func GetRedis

func GetRedis(config RedisConfig) *RedisWrapper

func (*RedisWrapper) ServiceHealth

func (c *RedisWrapper) ServiceHealth() (httphealthcheck.HealthStatusData, error)

func (*RedisWrapper) ServiceName

func (c *RedisWrapper) ServiceName() string

Jump to

Keyboard shortcuts

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