orm

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitXorm

func InitXorm(c *MySQLConfig) (db *xorm.Engine)

Types

type MySQLConfig

type MySQLConfig struct {
	DSN            string         `json:"dsn" yaml:"dsn" toml:"dsn"`                                        // data source name.
	MaxOpenConn    int            `json:"max_open_conn" yaml:"max_open_conn" toml:"max_open_conn"`          // pool, e.g:10
	MaxIdleConn    int            `json:"max_idle_conn" yaml:"max_idle_conn" toml:"max_idle_conn"`          // pool, e.g:100
	MaxConnTimeout xtime.Duration `json:"max_conn_timeout" yaml:"max_conn_timeout" toml:"max_conn_timeout"` // connect max life time. Unmarshal config file e.g:10s、2m、1m10s
	ShowSQL        bool           `json:"show_sql" yaml:"show_sql" toml:"show_sql"`
}

MySQLConfig mysql config.

type Page

type Page struct {
	PageNo   int `json:"page_no"`
	PageSize int `json:"page_size"`
}

func (*Page) Apply

func (p *Page) Apply(db *xorm.Session)

Jump to

Keyboard shortcuts

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