xgorm

package
v1.18.8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMysqlDB

func NewMysqlDB(cfg *DatabaseConfig) (*gorm.DB, error)

func RegisterCallBack

func RegisterCallBack(db *gorm.DB, callbacks ...Callback) error

Types

type Callback

type Callback struct {
	Name     string
	Action   string
	Before   string
	After    string
	Callback func(db *gorm.DB)
}

func (Callback) Valid

func (c Callback) Valid() error

type DatabaseConfig

type DatabaseConfig struct {
	Host         string
	Port         int
	Dbname       string
	Charset      string
	User         string
	Password     string
	MaxOpenConn  int
	MaxIdleConn  int
	ReadTimeout  int
	WriteTimeout int
	Timeout      int
	Debug        bool
}

Jump to

Keyboard shortcuts

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