Versions in this module Expand all Collapse all v0 v0.1.3 Feb 24, 2020 Changes in this version + func ArrayJoin(arr []string, sep string) string + func StringArrayContains(arr []string, item string) bool + func ToCamelString(s string) string + func ToSnakeString(s string) string + type Condition struct + Asc []string + Desc []string + Limit int + Offset int + Params []interface{} + Where string + type DBHandler struct + DB *xorm.Engine + Redis *redis.Client + func New(dbConf *DbConfig, redisConf *RedisConfig) (*DBHandler, error) + func (db *DBHandler) Count(name string, condition *Condition) (int64, error) + func (db *DBHandler) Del(bean interface{}, name string, id interface{}) error + func (db *DBHandler) Exec(sql string, params ...interface{}) error + func (db *DBHandler) Flush() error + func (db *DBHandler) Get(bean interface{}, name string, id interface{}) (bool, error) + func (db *DBHandler) GetOne(bean interface{}, name string, field string, value interface{}, ...) (bool, error) + func (db *DBHandler) List(bean interface{}, name string, condition *Condition) error + func (db *DBHandler) ListAndCount(bean interface{}, name string, condition *Condition) (int64, error) + func (db *DBHandler) MultiGet(bean interface{}, name string, idList []interface{}, columnNames ...string) error + func (db *DBHandler) Query(sql string, params ...interface{}) ([]map[string]interface{}, error) + func (db *DBHandler) Save(bean interface{}, name string, idName ...string) error + func (db *DBHandler) Sum(bean interface{}, name string, columnName string, condition *Condition) (float64, error) + func (db *DBHandler) SumInt(bean interface{}, name string, columnName string, condition *Condition) (int64, error) + func (db *DBHandler) Sums(bean interface{}, name string, condition *Condition, columnNames ...string) ([]float64, error) + func (db *DBHandler) SumsInt(bean interface{}, name string, condition *Condition, columnNames ...string) ([]int64, error) + type DbConfig struct + Charset string + DbName string + Host string + Password string + Port int + ShowLog bool + UserName string + type RedisConfig struct + DB int + Expire int64 + Host string + Password string + Port int