dbp

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DaemonTypeDBP boot.DaemonType = "dbp"
View Source
const (
	DefaultEnableExportMetrics = true
)

Variables

This section is empty.

Functions

func New

func New() boot.Daemon

Types

type Cfg

type Cfg struct {
	Pools               []*PoolCfg `` /* 175-byte string literal not displayed */
	EnableExportMetrics bool       `` /* 156-byte string literal not displayed */
}

func NewCfg

func NewCfg() *Cfg

type DBP

type DBP interface {
	boot.Daemon
	Get(string) *sql.DB
}

type PoolCfg

type PoolCfg struct {
	Name             string        `json:"name"                yaml:"name"`
	Type             string        `json:"type"                yaml:"type"`
	DSN              string        `json:"dsn"                 yaml:"dsn"`
	MaxIdle          int           `json:"max_idle"            yaml:"maxIdle"`
	MaxOpen          int           `json:"max_open"            yaml:"maxOpen"`
	MaxLifeTime      time.Duration `json:"max_life_time"       yaml:"maxLifeTime"`
	MaxIdleTime      time.Duration `json:"max_idle_time"       yaml:"maxIdleTime"`
	MaxWaitReadyTime time.Duration `json:"max_wait_ready_time" yaml:"maxWaitReadyTime"`
	ReadyQuery       string        `json:"ready_query"         yaml:"readyQuery"`
}

func (PoolCfg) MarshalFlag

func (pc PoolCfg) MarshalFlag() (string, error)

func (*PoolCfg) UnmarshalFlag

func (pc *PoolCfg) UnmarshalFlag(value string) error

Jump to

Keyboard shortcuts

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