xorm

package
v0.0.0-...-88f2d9e Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg interface {
	//get read mysql
	GetReadMysql() *MysqlCfg

	//GetWriteMysql get write mysql
	GetWriteMysql() *MysqlCfg
}

cfg

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

logger is a logger interface

func (*Logger) Debug

func (l *Logger) Debug(v ...interface{})

debug

func (*Logger) Debugf

func (l *Logger) Debugf(format string, v ...interface{})

debugf

func (*Logger) Error

func (l *Logger) Error(v ...interface{})

error

func (*Logger) Errorf

func (l *Logger) Errorf(format string, v ...interface{})

errorf

func (*Logger) Info

func (l *Logger) Info(v ...interface{})

info

func (*Logger) Infof

func (l *Logger) Infof(format string, v ...interface{})

infof

func (*Logger) IsShowSQL

func (l *Logger) IsShowSQL() bool

is show sql

func (*Logger) Level

func (l *Logger) Level() xorm.LogLevel

level

func (*Logger) SetLevel

func (l *Logger) SetLevel(level xorm.LogLevel)

set level

func (*Logger) ShowSQL

func (l *Logger) ShowSQL(show ...bool)

show sql

func (*Logger) Warn

func (l *Logger) Warn(v ...interface{})

warn

func (*Logger) Warnf

func (l *Logger) Warnf(format string, v ...interface{})

warnf

type Mysql

type Mysql struct {
	// contains filtered or unexported fields
}

mysql

func NewMysql

func NewMysql(cfg Cfg) *Mysql

NewMysql new mysql

func (*Mysql) GetReadEngine

func (m *Mysql) GetReadEngine() *basexorm.Engine

return read Mysql engine

func (*Mysql) GetWriteEngine

func (m *Mysql) GetWriteEngine() *basexorm.Engine

return write Mysql engine

type MysqlCfg

type MysqlCfg struct {
	//db ip
	DbIP string `ini:"DbIp"`
	//db pwd
	DbPWd string `ini:"DbPwd"`
	//db user
	DbUser string `ini:"DbUser"`
	//database
	Database string `ini:"Database"`
	//SetMaxIdleConns set the max idle connections on pool, default is 2
	MaxIdleConns int `ini:"MaxIdleConns"`
	//SetMaxOpenConns is only available for go 1.2+
	MaxOpenConns int `ini:"MaxOpenConns"`
	//SetConnMaxLifetime sets the maximum amount of time a connection may be reused.
	ConnMaxLifetime int `ini:"ConnMaxLifetime"`
	//log switch
	OpenLog bool `ini:"OpenLog"`
}

mysql config

Jump to

Keyboard shortcuts

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