across

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DemoParserFiles = map[string]string{
	"json": "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql_cluster.json",

	"toml": "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql.toml",
	"ini":  "/Users/fizz/go/src/github.com/gohouse/gorose/examples/demoParserFiles/mysql.ini",
}

临时配置, 方便 test 测试

View Source
var (
	Regex = []string{"=", ">", "<", "!=", "<>", ">=", "<=", "like", "not like", "in", "not in", "between", "not between"}
)

Functions

func Getter

func Getter(p string) (string, error)

Getter 获取类型分类

func Register

func Register(p string, ip string)

Register 注册类型分类

Types

type DbConfigCluster

type DbConfigCluster struct {
	Slave  []*DbConfigSingle // 多台读服务器, 如果启用则需要放入对应的多台从服务器配置
	Master *DbConfigSingle   // 一台主服务器负责写数据
}

数据库集群配置 如果不启用集群, 则直接使用 DbConfig 即可 如果仍然使用此配置为非集群, 则 Slave 配置置空即可, 等同于使用 DbConfig

type DbConfigSingle

type DbConfigSingle struct {
	Driver          string // 驱动: mysql/sqlite/oracle/mssql/postgres
	EnableQueryLog  bool   // 是否开启sql日志
	SetMaxOpenConns int    // (连接池)最大打开的连接数,默认值为0表示不限制
	SetMaxIdleConns int    // (连接池)闲置的连接数
	Prefix          string // 表前缀
	Dsn             string // 数据库链接
}

单一数据库配置

type OrmApi

type OrmApi struct {
	Driver                string
	Prefix                string
	Sforce                bool
	Sfields               []string
	Swhere                [][]interface{} // where
	Sorder                string          // order
	Slimit                int             // limit
	Soffset               int             // offset
	Sjoin                 [][]interface{} // join
	Sdistinct             bool            // distinct
	Sunion                string          // sum/count/avg/max/min
	Sgroup                string          // group
	Shaving               string          // having
	Sdata                 interface{}     // data
	Stx                   *sql.Tx         //Dbstruct Database
	SbeforeParseWhereData [][]interface{}
	Strans                bool
	LastInsertId          int64 // insert last insert id
	SqlLogs               []string
	LastSql               string
	// contains filtered or unexported fields
}

type TableType

type TableType int
const (
	TABLE_STRING       TableType = iota // 非结构体 表名字符串	("users")
	TABLE_STRUCT                        // 结构体 一条数据		(struct)
	TABLE_STRUCT_SLICE                  // 结构体 多条数据		([]struct)
)

Jump to

Keyboard shortcuts

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