Documentation ¶
Index ¶
- Variables
- type ArgsAddress
- type ArgsConfig
- type ArgsConfigList
- type ArgsGPS
- type ArgsID
- type ArgsPages
- type ArgsTimeBetween
- type Client
- func (t *Client) Analysis() *ClientAnalysisCtx
- func (t *Client) Delete() *ClientDeleteCtx
- func (t *Client) Get() *ClientGetCtx
- func (t *Client) GetKey() string
- func (t *Client) Init(mainDB *SQLClient, tableName string) *Client
- func (t *Client) Insert() *ClientInsertCtx
- func (t *Client) Select() *ClientListCtx
- func (t *Client) SetCache(obj *CoreCache.CacheData) *Client
- func (t *Client) SetCreateLock(b bool) *Client
- func (t *Client) SetDeleteLock(b bool) *Client
- func (t *Client) SetEditLock(b bool) *Client
- func (t *Client) SetExpireSec(sec int) *Client
- func (t *Client) SetKey(key string) *Client
- func (t *Client) SetUpdateLock(b bool) *Client
- func (t *Client) SetViewLock(b bool) *Client
- func (t *Client) Update() *ClientUpdateCtx
- type ClientAnalysisCountFieldCtx
- type ClientAnalysisCtx
- func (t *ClientAnalysisCtx) AVG(where string, args ...any) (val float64)
- func (t *ClientAnalysisCtx) Count(where string, args ...any) (val int64)
- func (t *ClientAnalysisCtx) DataNoDelete() *ClientAnalysisCtx
- func (t *ClientAnalysisCtx) Max(where string, args ...any) (val int64)
- func (t *ClientAnalysisCtx) Min(where string, args ...any) (val int64)
- func (t *ClientAnalysisCtx) Sum(data any, fields []string, where string, args ...any) (err error)
- func (t *ClientAnalysisCtx) Sum2(where string, args ...any) (val int64)
- type ClientCtx
- func (t *ClientCtx) DataNoDelete() *ClientCtx
- func (t *ClientCtx) Exec(query string, args ...any) (sql.Result, error)
- func (t *ClientCtx) Get(dest interface{}, query string, args ...interface{}) error
- func (t *ClientCtx) GetFields(l []string) string
- func (t *ClientCtx) MustBegin() *sqlx.Tx
- func (t *ClientCtx) NamedExec(query string, arg interface{}) (sql.Result, error)
- func (t *ClientCtx) Ping() error
- func (t *ClientCtx) PrepareNamed(query string) (*sqlx.NamedStmt, error)
- func (t *ClientCtx) Select(dest interface{}, query string, args ...interface{}) error
- type ClientDeleteCtx
- func (t *ClientDeleteCtx) AddWhereID(id int64) *ClientDeleteCtx
- func (t *ClientDeleteCtx) AddWhereOrgID(orgID int64) *ClientDeleteCtx
- func (t *ClientDeleteCtx) AddWhereUserID(userID int64) *ClientDeleteCtx
- func (t *ClientDeleteCtx) Exec(where string, args ...any) error
- func (t *ClientDeleteCtx) ExecAny(arg interface{}) error
- func (t *ClientDeleteCtx) ExecNamed(arg map[string]interface{}) error
- func (t *ClientDeleteCtx) NeedSoft(b bool) *ClientDeleteCtx
- func (t *ClientDeleteCtx) SetWhereAnd(name string, val interface{}) *ClientDeleteCtx
- func (t *ClientDeleteCtx) SetWhereOrThan(name string, val interface{}) *ClientDeleteCtx
- func (t *ClientDeleteCtx) SetWhereStr(where string, arg map[string]interface{}) *ClientDeleteCtx
- type ClientGetCtx
- func (t *ClientGetCtx) AppendWhere(where string, args ...interface{}) *ClientGetCtx
- func (t *ClientGetCtx) GetByCodeAndOrgID(code string, orgID int64) *ClientGetCtx
- func (t *ClientGetCtx) GetByID(id int64) *ClientGetCtx
- func (t *ClientGetCtx) GetByIDAndOrgID(id int64, orgID int64) *ClientGetCtx
- func (t *ClientGetCtx) GetByIDAndUserID(id int64, userID int64) *ClientGetCtx
- func (t *ClientGetCtx) GetByMarkAndOrgID(mark string, orgID int64) *ClientGetCtx
- func (t *ClientGetCtx) NeedLimit() *ClientGetCtx
- func (t *ClientGetCtx) NeedSort(needSort bool, sortField string, sortIsDesc bool) *ClientGetCtx
- func (t *ClientGetCtx) Result(data interface{}) error
- func (t *ClientGetCtx) SetFieldsOne(fields []string) *ClientGetCtx
- type ClientInsertCtx
- func (t *ClientInsertCtx) Add(args interface{}) *ClientInsertCtx
- func (t *ClientInsertCtx) Exec() error
- func (t *ClientInsertCtx) ExecAndCheckID() error
- func (t *ClientInsertCtx) ExecAndResultData(data interface{}) error
- func (t *ClientInsertCtx) ExecAndResultID() (int64, error)
- func (t *ClientInsertCtx) SetFields(fields []string) *ClientInsertCtx
- type ClientListCtx
- func (t *ClientListCtx) Result(data interface{}) error
- func (t *ClientListCtx) ResultAndCount(data interface{}) (count int64, err error)
- func (t *ClientListCtx) ResultCount() (count int64, err error)
- func (t *ClientListCtx) SelectList(where string, args ...interface{}) *ClientListCtx
- func (t *ClientListCtx) SetDeleteQuery(field string, param bool) *ClientListCtx
- func (t *ClientListCtx) SetFieldsList(fields []string) *ClientListCtx
- func (t *ClientListCtx) SetFieldsSort(fields []string) *ClientListCtx
- func (t *ClientListCtx) SetIDQuery(field string, param int64) *ClientListCtx
- func (t *ClientListCtx) SetIDsQuery(field string, param pq.Int64Array) *ClientListCtx
- func (t *ClientListCtx) SetIntQuery(field string, param int) *ClientListCtx
- func (t *ClientListCtx) SetPages(pages ArgsPages) *ClientListCtx
- func (t *ClientListCtx) SetSearchQuery(fields []string, search string) *ClientListCtx
- func (t *ClientListCtx) SetStringQuery(field string, param string) *ClientListCtx
- func (t *ClientListCtx) SetTimeBetweenQuery(field string, startAt time.Time, endAt time.Time) *ClientListCtx
- type ClientUpdateCtx
- func (t *ClientUpdateCtx) AddWhereID(id int64) *ClientUpdateCtx
- func (t *ClientUpdateCtx) AddWhereOrgID(orgID int64) *ClientUpdateCtx
- func (t *ClientUpdateCtx) AddWhereUserID(userID int64) *ClientUpdateCtx
- func (t *ClientUpdateCtx) NamedExec(arg map[string]interface{}) error
- func (t *ClientUpdateCtx) NeedSoft(b bool) *ClientUpdateCtx
- func (t *ClientUpdateCtx) NeedUpdateTime() *ClientUpdateCtx
- func (t *ClientUpdateCtx) SetFieldStr(fields string) *ClientUpdateCtx
- func (t *ClientUpdateCtx) SetFields(fields []string) *ClientUpdateCtx
- func (t *ClientUpdateCtx) SetWhereAnd(name string, val interface{}) *ClientUpdateCtx
- func (t *ClientUpdateCtx) SetWhereOrThan(name string, val interface{}) *ClientUpdateCtx
- func (t *ClientUpdateCtx) SetWhereStr(where string, arg map[string]interface{}) *ClientUpdateCtx
- type FieldsAddress
- type FieldsConfig
- type FieldsConfigList
- func (t FieldsConfigList) CheckVal(mark string, val string) (nowVal string, b bool)
- func (t FieldsConfigList) GetVal(mark string) (val string, b bool)
- func (t FieldsConfigList) GetValBool(mark string) (val bool, b bool)
- func (t FieldsConfigList) GetValFloat64(mark string) (val float64, b bool)
- func (t FieldsConfigList) GetValInt(mark string) (val int, b bool)
- func (t FieldsConfigList) GetValInt64(mark string) (val int64, b bool)
- func (t FieldsConfigList) GetValInt64NoBool(mark string) (val int64)
- func (t FieldsConfigList) GetValNoBool(mark string) (val string)
- func (t FieldsConfigList) GetValNoErr(mark string) (val string)
- func (t *FieldsConfigList) Scan(value interface{}) error
- func (t FieldsConfigList) Value() (driver.Value, error)
- type FieldsGPS
- type FieldsTimeBetween
- type SQLClient
- type WaitLogType
Constants ¶
This section is empty.
Variables ¶
var ( //WaitLog 为减少和外部模块的侵入性,此设计将记录一些必要的元素内容,外部抽取后释放即可 // 等待处理的请求记录 WaitLog []WaitLogType WaitLogLock sync.Mutex )
var ( //OpenDebug debug OpenDebug = false )
Functions ¶
This section is empty.
Types ¶
type ArgsAddress ¶
type ArgsAddress struct { //所属国家 国家代码 // eg: china => 86 Country int `db:"country" json:"country" check:"country" empty:"true"` //省份 编码 // eg: 710000 Province int `db:"province" json:"province"` //所属城市 City int `db:"city" json:"city" check:"city" empty:"true"` //街道详细信息 Address string `db:"address" json:"address"` //地图制式 // 0 WGS-84 / 1 GCJ-02 / 2 BD-09 MapType int `db:"map_type" json:"mapType"` //坐标位置 Longitude float64 `db:"longitude" json:"longitude"` Latitude float64 `db:"latitude" json:"latitude"` //联系人姓名 Name string `db:"name" json:"name"` //联系人国家代码 NationCode string `db:"nation_code" json:"nationCode"` //联系人手机号 Phone string `db:"phone" json:"phone"` }
func (*ArgsAddress) GetField ¶
func (t *ArgsAddress) GetField() FieldsAddress
type ArgsConfig ¶
type ArgsConfig struct { //标识码 Mark string `db:"mark" json:"mark" check:"mark" empty:"true"` //值 Val string `db:"val" json:"val"` }
ArgsConfig 扩展结构
func (*ArgsConfig) GetField ¶
func (t *ArgsConfig) GetField() FieldsConfig
type ArgsConfigList ¶
type ArgsConfigList []ArgsConfig
func (ArgsConfigList) GetFields ¶
func (t ArgsConfigList) GetFields() FieldsConfigList
type ArgsGPS ¶
type ArgsPages ¶
type ArgsPages struct { Page int64 `json:"page" check:"page"` Max int64 `json:"max" check:"max"` Sort string `json:"sort" check:"sort"` Desc bool `json:"desc" check:"desc"` }
ArgsPages 分页结构体
type ArgsTimeBetween ¶
type ArgsTimeBetween struct { //最小时间 // Default时间 MinTime string `json:"minTime" check:"defaultTime"` //最大时间 // Default时间 MaxTime string `json:"maxTime" check:"defaultTime"` }
func (*ArgsTimeBetween) GetFields ¶
func (t *ArgsTimeBetween) GetFields() (FieldsTimeBetween, error)
type Client ¶
type Client struct { //sql操作核心 DB *SQLClient //表名称 TableName string //关键索引 Key string // contains filtered or unexported fields }
Client 操作表核心 具体的表定义对象即可使用
func (*Client) Analysis ¶
func (t *Client) Analysis() *ClientAnalysisCtx
func (*Client) Delete ¶
func (t *Client) Delete() *ClientDeleteCtx
func (*Client) Get ¶
func (t *Client) Get() *ClientGetCtx
func (*Client) Insert ¶
func (t *Client) Insert() *ClientInsertCtx
func (*Client) Select ¶
func (t *Client) Select() *ClientListCtx
func (*Client) SetCreateLock ¶
func (*Client) SetDeleteLock ¶
func (*Client) SetEditLock ¶
func (*Client) SetExpireSec ¶
func (*Client) SetUpdateLock ¶
func (*Client) SetViewLock ¶
func (*Client) Update ¶
func (t *Client) Update() *ClientUpdateCtx
type ClientAnalysisCtx ¶
type ClientAnalysisCtx struct {
// contains filtered or unexported fields
}
ClientAnalysisCtx 排名处理器
func (*ClientAnalysisCtx) AVG ¶
func (t *ClientAnalysisCtx) AVG(where string, args ...any) (val float64)
func (*ClientAnalysisCtx) Count ¶
func (t *ClientAnalysisCtx) Count(where string, args ...any) (val int64)
func (*ClientAnalysisCtx) DataNoDelete ¶
func (t *ClientAnalysisCtx) DataNoDelete() *ClientAnalysisCtx
DataNoDelete SQL结构体不含删除标记
func (*ClientAnalysisCtx) Max ¶
func (t *ClientAnalysisCtx) Max(where string, args ...any) (val int64)
func (*ClientAnalysisCtx) Min ¶
func (t *ClientAnalysisCtx) Min(where string, args ...any) (val int64)
type ClientCtx ¶
type ClientCtx struct {
// contains filtered or unexported fields
}
func (*ClientCtx) DataNoDelete ¶
func (*ClientCtx) Exec ¶
Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.
Exec uses context.Background internally; to specify the context, use ExecContext.
func (*ClientCtx) Get ¶
Get using this DB. Any placeholder parameters are replaced with supplied args. An error is returned if the result set is empty.
func (*ClientCtx) MustBegin ¶
MustBegin starts a transaction, and panics on error. Returns an *sqlx.Tx instead of an *sql.Tx.
func (*ClientCtx) NamedExec ¶
NamedExec using this DB. Any named placeholder parameters are replaced with fields from arg.
func (*ClientCtx) Ping ¶
Ping verifies a connection to the database is still alive, establishing a connection if necessary.
Ping uses context.Background internally; to specify the context, use PingContext.
func (*ClientCtx) PrepareNamed ¶
PrepareNamed returns an sqlx.NamedStmt
type ClientDeleteCtx ¶
type ClientDeleteCtx struct {
// contains filtered or unexported fields
}
func (*ClientDeleteCtx) AddWhereID ¶
func (t *ClientDeleteCtx) AddWhereID(id int64) *ClientDeleteCtx
AddWhereID 添加ID条件
func (*ClientDeleteCtx) AddWhereOrgID ¶
func (t *ClientDeleteCtx) AddWhereOrgID(orgID int64) *ClientDeleteCtx
AddWhereOrgID 添加组织ID条件
func (*ClientDeleteCtx) AddWhereUserID ¶
func (t *ClientDeleteCtx) AddWhereUserID(userID int64) *ClientDeleteCtx
AddWhereUserID 添加用户ID条件
func (*ClientDeleteCtx) Exec ¶
func (t *ClientDeleteCtx) Exec(where string, args ...any) error
Exec 执行删除
func (*ClientDeleteCtx) ExecAny ¶
func (t *ClientDeleteCtx) ExecAny(arg interface{}) error
ExecAny 执行删除
func (*ClientDeleteCtx) ExecNamed ¶
func (t *ClientDeleteCtx) ExecNamed(arg map[string]interface{}) error
ExecNamed 执行删除 需要给与map[string]interface{}的参数 如果没有,则可以给与nil,程序会自动跳过
func (*ClientDeleteCtx) NeedSoft ¶
func (t *ClientDeleteCtx) NeedSoft(b bool) *ClientDeleteCtx
NeedSoft 是否软删除
func (*ClientDeleteCtx) SetWhereAnd ¶
func (t *ClientDeleteCtx) SetWhereAnd(name string, val interface{}) *ClientDeleteCtx
SetWhereAnd 添加等于关系判断
func (*ClientDeleteCtx) SetWhereOrThan ¶
func (t *ClientDeleteCtx) SetWhereOrThan(name string, val interface{}) *ClientDeleteCtx
SetWhereOrThan 设置条件或查询关系 可用于负数跳过、0以上等于的判断机制
func (*ClientDeleteCtx) SetWhereStr ¶
func (t *ClientDeleteCtx) SetWhereStr(where string, arg map[string]interface{}) *ClientDeleteCtx
SetWhereStr 追加覆盖条件部分
type ClientGetCtx ¶
type ClientGetCtx struct {
// contains filtered or unexported fields
}
func (*ClientGetCtx) AppendWhere ¶
func (t *ClientGetCtx) AppendWhere(where string, args ...interface{}) *ClientGetCtx
func (*ClientGetCtx) GetByCodeAndOrgID ¶
func (t *ClientGetCtx) GetByCodeAndOrgID(code string, orgID int64) *ClientGetCtx
func (*ClientGetCtx) GetByID ¶
func (t *ClientGetCtx) GetByID(id int64) *ClientGetCtx
func (*ClientGetCtx) GetByIDAndOrgID ¶
func (t *ClientGetCtx) GetByIDAndOrgID(id int64, orgID int64) *ClientGetCtx
func (*ClientGetCtx) GetByIDAndUserID ¶
func (t *ClientGetCtx) GetByIDAndUserID(id int64, userID int64) *ClientGetCtx
func (*ClientGetCtx) GetByMarkAndOrgID ¶
func (t *ClientGetCtx) GetByMarkAndOrgID(mark string, orgID int64) *ClientGetCtx
func (*ClientGetCtx) NeedLimit ¶
func (t *ClientGetCtx) NeedLimit() *ClientGetCtx
NeedLimit 限制避免条件过于宽松,造成获取多条数据的异常问题
func (*ClientGetCtx) NeedSort ¶
func (t *ClientGetCtx) NeedSort(needSort bool, sortField string, sortIsDesc bool) *ClientGetCtx
NeedSort 启动排序,用于反馈仅有数据时,获得最新或最早一条数据的设计
func (*ClientGetCtx) Result ¶
func (t *ClientGetCtx) Result(data interface{}) error
func (*ClientGetCtx) SetFieldsOne ¶
func (t *ClientGetCtx) SetFieldsOne(fields []string) *ClientGetCtx
type ClientInsertCtx ¶
type ClientInsertCtx struct {
// contains filtered or unexported fields
}
func (*ClientInsertCtx) Add ¶
func (t *ClientInsertCtx) Add(args interface{}) *ClientInsertCtx
func (*ClientInsertCtx) Exec ¶
func (t *ClientInsertCtx) Exec() error
Exec 执行 TODO: 核对代码存在问题,参数没有正确写入
func (*ClientInsertCtx) ExecAndCheckID ¶
func (t *ClientInsertCtx) ExecAndCheckID() error
func (*ClientInsertCtx) ExecAndResultData ¶
func (t *ClientInsertCtx) ExecAndResultData(data interface{}) error
ExecAndResultData 执行并返回数据 TODO: 部分场景下正常写入,但反馈失败信息
func (*ClientInsertCtx) ExecAndResultID ¶
func (t *ClientInsertCtx) ExecAndResultID() (int64, error)
func (*ClientInsertCtx) SetFields ¶
func (t *ClientInsertCtx) SetFields(fields []string) *ClientInsertCtx
type ClientListCtx ¶
type ClientListCtx struct {
// contains filtered or unexported fields
}
func (*ClientListCtx) Result ¶
func (t *ClientListCtx) Result(data interface{}) error
func (*ClientListCtx) ResultAndCount ¶
func (t *ClientListCtx) ResultAndCount(data interface{}) (count int64, err error)
func (*ClientListCtx) ResultCount ¶ added in v5.1.2
func (t *ClientListCtx) ResultCount() (count int64, err error)
func (*ClientListCtx) SelectList ¶
func (t *ClientListCtx) SelectList(where string, args ...interface{}) *ClientListCtx
SelectList 如果启用了自动组合方法,请尽可能不要使用本方法where和args,否则请在where条件中明确一共注入了几个参数,并从对应参数为起点计算,避免$x顺序不匹配
func (*ClientListCtx) SetDeleteQuery ¶
func (t *ClientListCtx) SetDeleteQuery(field string, param bool) *ClientListCtx
SetDeleteQuery 设置删除查询 如果启动此设定,请注意基于查询条件的$顺序,叠加后使用,否则讲造成条件和参数不匹配
func (*ClientListCtx) SetFieldsList ¶
func (t *ClientListCtx) SetFieldsList(fields []string) *ClientListCtx
func (*ClientListCtx) SetFieldsSort ¶
func (t *ClientListCtx) SetFieldsSort(fields []string) *ClientListCtx
func (*ClientListCtx) SetIDQuery ¶
func (t *ClientListCtx) SetIDQuery(field string, param int64) *ClientListCtx
SetIDQuery 常规ID判断查询
func (*ClientListCtx) SetIDsQuery ¶ added in v5.1.5
func (t *ClientListCtx) SetIDsQuery(field string, param pq.Int64Array) *ClientListCtx
SetIDsQuery 常规IDs判断查询
func (*ClientListCtx) SetIntQuery ¶ added in v5.1.5
func (t *ClientListCtx) SetIntQuery(field string, param int) *ClientListCtx
SetIntQuery 常规Int判断查询
func (*ClientListCtx) SetPages ¶
func (t *ClientListCtx) SetPages(pages ArgsPages) *ClientListCtx
func (*ClientListCtx) SetSearchQuery ¶
func (t *ClientListCtx) SetSearchQuery(fields []string, search string) *ClientListCtx
SetSearchQuery 设置搜索查询 如果启动此设定,请注意基于查询条件的$顺序,叠加后使用,否则讲造成条件和参数不匹配
func (*ClientListCtx) SetStringQuery ¶
func (t *ClientListCtx) SetStringQuery(field string, param string) *ClientListCtx
SetStringQuery 常规字符串判断查询
func (*ClientListCtx) SetTimeBetweenQuery ¶ added in v5.1.8
func (t *ClientListCtx) SetTimeBetweenQuery(field string, startAt time.Time, endAt time.Time) *ClientListCtx
SetTimeBetweenQuery 设置时间范围
type ClientUpdateCtx ¶
type ClientUpdateCtx struct {
// contains filtered or unexported fields
}
func (*ClientUpdateCtx) AddWhereID ¶
func (t *ClientUpdateCtx) AddWhereID(id int64) *ClientUpdateCtx
func (*ClientUpdateCtx) AddWhereOrgID ¶
func (t *ClientUpdateCtx) AddWhereOrgID(orgID int64) *ClientUpdateCtx
func (*ClientUpdateCtx) AddWhereUserID ¶
func (t *ClientUpdateCtx) AddWhereUserID(userID int64) *ClientUpdateCtx
func (*ClientUpdateCtx) NamedExec ¶
func (t *ClientUpdateCtx) NamedExec(arg map[string]interface{}) error
func (*ClientUpdateCtx) NeedSoft ¶
func (t *ClientUpdateCtx) NeedSoft(b bool) *ClientUpdateCtx
NeedSoft 是否软删除
func (*ClientUpdateCtx) NeedUpdateTime ¶
func (t *ClientUpdateCtx) NeedUpdateTime() *ClientUpdateCtx
func (*ClientUpdateCtx) SetFieldStr ¶
func (t *ClientUpdateCtx) SetFieldStr(fields string) *ClientUpdateCtx
func (*ClientUpdateCtx) SetFields ¶
func (t *ClientUpdateCtx) SetFields(fields []string) *ClientUpdateCtx
func (*ClientUpdateCtx) SetWhereAnd ¶
func (t *ClientUpdateCtx) SetWhereAnd(name string, val interface{}) *ClientUpdateCtx
func (*ClientUpdateCtx) SetWhereOrThan ¶
func (t *ClientUpdateCtx) SetWhereOrThan(name string, val interface{}) *ClientUpdateCtx
func (*ClientUpdateCtx) SetWhereStr ¶
func (t *ClientUpdateCtx) SetWhereStr(where string, arg map[string]interface{}) *ClientUpdateCtx
SetWhereStr 追加覆盖条件部分
type FieldsAddress ¶
type FieldsAddress struct { //所属国家 国家代码 // eg: china => 86 Country int `db:"country" json:"country"` //省份 编码 // eg: 710000 Province int `db:"province" json:"province"` //所属城市 City int `db:"city" json:"city" check:"city"` //街道详细信息 Address string `db:"address" json:"address"` //地图制式 // 0 WGS-84 / 1 GCJ-02 / 2 BD-09 MapType int `db:"map_type" json:"mapType"` //坐标位置 Longitude float64 `db:"longitude" json:"longitude"` Latitude float64 `db:"latitude" json:"latitude"` //联系人姓名 Name string `db:"name" json:"name"` //联系人国家代码 NationCode string `db:"nation_code" json:"nationCode"` //联系人手机号 Phone string `db:"phone" json:"phone"` }
FieldsAddress 通用地址结构
func (*FieldsAddress) Check ¶
func (t *FieldsAddress) Check() (err error)
func (*FieldsAddress) GetMapType ¶
func (t *FieldsAddress) GetMapType() (data string)
func (*FieldsAddress) Scan ¶
func (t *FieldsAddress) Scan(value interface{}) error
type FieldsConfig ¶
type FieldsConfig struct { //标识码 Mark string `db:"mark" json:"mark"` //值 Val string `db:"val" json:"val"` }
FieldsConfig 扩展结构
func (*FieldsConfig) Scan ¶
func (t *FieldsConfig) Scan(value interface{}) error
type FieldsConfigList ¶
type FieldsConfigList []FieldsConfig
FieldsConfigList 简化得扩展结构
func (FieldsConfigList) CheckVal ¶
func (t FieldsConfigList) CheckVal(mark string, val string) (nowVal string, b bool)
CheckVal 检查一组数据内的值是否匹配
func (FieldsConfigList) GetVal ¶
func (t FieldsConfigList) GetVal(mark string) (val string, b bool)
GetVal 抽取指定的值
func (FieldsConfigList) GetValBool ¶
func (t FieldsConfigList) GetValBool(mark string) (val bool, b bool)
GetValBool 抽取指定的值
func (FieldsConfigList) GetValFloat64 ¶
func (t FieldsConfigList) GetValFloat64(mark string) (val float64, b bool)
GetValFloat64 抽取指定的值
func (FieldsConfigList) GetValInt ¶
func (t FieldsConfigList) GetValInt(mark string) (val int, b bool)
GetValInt 抽取指定的值
func (FieldsConfigList) GetValInt64 ¶
func (t FieldsConfigList) GetValInt64(mark string) (val int64, b bool)
GetValInt64 抽取指定的值
func (FieldsConfigList) GetValInt64NoBool ¶
func (t FieldsConfigList) GetValInt64NoBool(mark string) (val int64)
func (FieldsConfigList) GetValNoBool ¶
func (t FieldsConfigList) GetValNoBool(mark string) (val string)
func (FieldsConfigList) GetValNoErr ¶
func (t FieldsConfigList) GetValNoErr(mark string) (val string)
func (*FieldsConfigList) Scan ¶
func (t *FieldsConfigList) Scan(value interface{}) error
type FieldsGPS ¶
type FieldsGPS struct { //坐标位置 Longitude float64 `db:"longitude" json:"longitude"` Latitude float64 `db:"latitude" json:"latitude"` }
FieldsGPS 坐标设计
type FieldsTimeBetween ¶
type FieldsTimeBetween struct { //最小时间 MinTime time.Time `json:"minTime"` //最大时间 MaxTime time.Time `json:"maxTime"` }
func (*FieldsTimeBetween) GetData ¶
func (t *FieldsTimeBetween) GetData() ArgsTimeBetween
type SQLClient ¶
type SQLClient struct {
// contains filtered or unexported fields
}
SQLClient SQL操作控制器核心 初始化连接后需使用本结构构建控制对象,写入基础数据集
func (*SQLClient) GetPostgresql ¶
func (t *SQLClient) GetPostgresql() *CorePostgres.Client
GetPostgresql 获取postgresql句柄
func (*SQLClient) InitPostgresql ¶
func (t *SQLClient) InitPostgresql(mainDB *CorePostgres.Client)
InitPostgresql 初始化
Source Files ¶
- args_address.go
- args_between.go
- args_config.go
- args_gps.go
- args_id.go
- args_page.go
- client.go
- client_cache.go
- client_core.go
- client_tools.go
- client_tools_analysis.go
- client_tools_delete.go
- client_tools_get.go
- client_tools_insert.go
- client_tools_select.go
- client_tools_update.go
- core.go
- db_stretch.go
- log.go