db

package
v0.0.0-...-8ba6176 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 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 Dao

type Dao interface {
	SetDB(dc *DbConf) error                 // 设置数据源
	QueryTables(string) (*EventInfo, error) // 查询所有表
}

func NewDao

func NewDao(dbType string) Dao

type DaoBase

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

type DbConf

type DbConf struct {
	User            string `json:"user"`            // 用户
	Password        string `json:"password"`        // 密码
	Host            string `json:"host"`            // 主机地址
	Port            string `json:"port"`            // 端口
	Database        string `json:"database"`        // 数据库
	Charset         string `json:"charset"`         // 默认 UTF8
	ParseTime       bool   `json:"parseTime"`       // 默认 true
	MaxOpenConns    int    `json:"maxOpenConns"`    // 最大连接数 默认 1
	MaxIdleConns    int    `json:"maxIdleConns"`    // 初始化连接数 默认 1
	ConnMaxLifetime int    `json:"connMaxLifetime"` // 存活时间 默认30s
}

func NewDbConf

func NewDbConf(host, port, user, pass, database, schema, table string) *DbConf

type EventInfo

type EventInfo struct {
	Fid       int    `db:"Fid"`
	Fevent_id string `db:"Fevent_id"`
}

Jump to

Keyboard shortcuts

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