pgsql

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

func Init

func Init(cfg *Config) (err error)

func NewDBTable

func NewDBTable(name string) dbTable

Types

type Config

type Config struct {
	Host    string `json:"host"     required:"true"`
	User    string `json:"user"     required:"true"`
	Pwd     string `json:"pwd"      required:"true"`
	Name    string `json:"name"     required:"true"`
	Port    int    `json:"port"     required:"true"`
	Life    int    `json:"life"     required:"true"`
	MaxConn int    `json:"max_conn" required:"true"`
	MaxIdle int    `json:"max_idle" required:"true"`
	DBCert  string `json:"db_cert"  required:"true"`
}

DbLife: the unit is minute

func (*Config) SetDefault

func (p *Config) SetDefault()

type Pagination

type Pagination struct {
	PageNum      int
	CountPerPage int
}

type SortByColumn

type SortByColumn struct {
	Column string
	Ascend bool
}

Jump to

Keyboard shortcuts

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