db_xorm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

description: superwallet

@author: xwc1125 @date: 2020/10/05

description: Leetcode

@author: xwc1125 @date: 2020/10/05

description: sync_eth

@author: xwc1125 @date: 2020/10/05

Index

Constants

View Source
const (
	ABLE int64 = iota
	UNABLE
	DELETE
	UNACTIVE
)

Variables

View Source
var SysTimeLocation, _ = time.LoadLocation("Asia/Shanghai")

Functions

func GetConnURL

func GetConnURL(info *MysqlConfig) (url string)

func MasterEngine

func MasterEngine(master MysqlConfig) *xorm.Engine

Types

type CursorResult

type CursorResult struct {
	Results interface{} `json:"results"`
	Cursor  string      `json:"cursor"`
}

type MysqlConfig

type MysqlConfig struct {
	DriverName   string `json:"driverName" mapstructure:"driverName"`
	User         string `json:"user" mapstructure:"user"`
	Password     string `json:"password" mapstructure:"password"`
	Host         string `json:"host" mapstructure:"host"`
	Port         int    `json:"port" mapstructure:"port"`
	Database     string `json:"database" mapstructure:"database"`
	Charset      string `json:"charset" mapstructure:"charset"`
	ShowSql      bool   `json:"showSql" mapstructure:"showSql"`
	LogLevel     string `json:"logLevel" mapstructure:"logLevel"`
	MaxIdleConns int    `json:"maxIdleConns" mapstructure:"maxIdleConns"`
	MaxOpenConns int    `json:"maxOpenConns" mapstructure:"maxOpenConns"`
	//ParseTime       bool   `json:"parseTime" mapstructure:"parseTime"`
	ConnMaxLifetime int64 `json:"connMaxLifetime" mapstructure:"connMaxLifetime: 10"` // s

}

type OrderByCol

type OrderByCol struct {
	Column string
	Asc    bool
}

type PageResult

type PageResult struct {
	Page    *Paging     `json:"page"`
	Results interface{} `json:"results"`
}

type PageWhereOrder

type PageWhereOrder struct {
	Order string
	Where string
	Value []interface{}
}

type Paging

type Paging struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
	Total int `json:"total"`
}

func (*Paging) Offset

func (p *Paging) Offset() int

func (*Paging) TotalPage

func (p *Paging) TotalPage() int

type XormModel

type XormModel struct {
	Id         int64  `xorm:"pk autoincr INT(11) notnull" json:"id" form:"id"`
	CreateTime int64  `xorm:"bigint(15) " json:"createTime"`
	CreateBy   string `xorm:"varchar(55)" json:"createBy"`
	UpdateTime int64  `xorm:"bigint(15) " json:"updateTime"`
	UpdateBy   string `xorm:"varchar(55)" json:"updateBy"`
	Remark     string `xorm:"varchar(500)" json:"remark"`
	Status     int64  `xorm:"int(8) notnull default(0)" json:"status"`
}

Xorm

func (*XormModel) GetById

func (m *XormModel) GetById(master MysqlConfig, id int64, bean interface{}) error

type XormModel1

type XormModel1 struct {
	Id         int64  `xorm:"pk autoincr INT(11) notnull" json:"id" form:"id"`
	CreateTime int64  `xorm:"bigint(15) " json:"createTime"`
	UpdateTime int64  `xorm:"bigint(15) " json:"updateTime"`
	Remark     string `xorm:"varchar(500)" json:"remark"`
	Status     int64  `xorm:"int(8) notnull default(0)" json:"status"`
}

type XormModel2

type XormModel2 struct {
	Id         int64 `xorm:"pk autoincr INT(11) notnull" json:"id" form:"id"`
	CreateTime int64 `xorm:"bigint(15) " json:"createTime"`
	UpdateTime int64 `xorm:"bigint(15) " json:"updateTime"`
	Status     int64 `xorm:"int(8) notnull default(0)" json:"status"`
}

type XormModelId

type XormModelId struct {
	Id int64 `xorm:"pk autoincr INT(11) notnull" json:"id" form:"id"` // ID
}

Jump to

Keyboard shortcuts

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