db

package
v0.0.0-...-446c871 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NowUTC = func() time.Time {
		return time.Now().UTC()
	}

	NowTZ = func() time.Time {
		return time.Now().In(loc)
	}
)

Functions

func InitTimezone

func InitTimezone(tz string)

Types

type Client

type Client interface {
	Instance() *gorm.DB
	ping.Pingable
}

func New

func New(cfg Config) Client

type Config

type Config struct {
	Driver          Driver
	DSN             string
	Timezone        string
	MaxOpenConn     int
	MaxIdleConn     int
	ConnMaxIdleTime int
	ConnMaxLifeTime int
}

type Driver

type Driver string
const (
	MySQL    Driver = "mysql"
	Postgres Driver = "postgres"
)

Jump to

Keyboard shortcuts

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