Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(database int, key string) error
- func DeleteSql(obj interface{}, params ...OpOption) string
- func Do(database int, pFunc func(c redis.Conn) (reply interface{}, err error)) (reply interface{}, err error)
- func Exist(database int, key string) bool
- func Expire(database, timeout int, key string) error
- func Get(database int, key string) ([]byte, error)
- func GetDBTimeString(t int64) string
- func InsertSql(obj interface{}, params ...OpOption) string
- func LoadObjSql(obj interface{}, row IRow) bool
- func LoadSql(obj interface{}, params ...OpOption) string
- func OpenDB(conf common.Mysql) error
- func OpenRedisPool(ip, pwd string) error
- func SaveSql(obj interface{}, params ...OpOption) string
- func SaveSqlStr(sqlData *SqlData) string
- func Set(database int, timeout int, key string, val interface{}) (err error)
- func UpdateSql(obj interface{}, params ...OpOption) string
- func WhereSql(obj interface{}, params ...OpOption) string
- type Colunm
- type Datetime
- type IRow
- type IRows
- type Op
- type OpOption
- type PROTYPE
- type Properties
- type Row
- func (this *Row) Bool(key string) bool
- func (this *Row) Byte(key string) []byte
- func (this *Row) Float32(key string) float32
- func (this *Row) Float64(key string) float64
- func (this *Row) Get(key string) string
- func (this *Row) Int(key string) int
- func (this *Row) Int64(key string) int64
- func (this *Row) KV() map[string]string
- func (this *Row) Obj(obj interface{}) bool
- func (this *Row) Set(key, val string)
- func (this *Row) String(key string) string
- func (this *Row) Time(key string) int64
- type Rows
- type SQLTYPE
- type SqlData
- type Table
Constants ¶
View Source
const (
MAX_ARRAY_LENGTH = 64
)
Variables ¶
View Source
var (
DB *sql.DB
)
View Source
var (
POOL *redis.Pool
)
Functions ¶
func Do ¶
func Do(database int, pFunc func(c redis.Conn) (reply interface{}, err error)) (reply interface{}, err error)
/Do a func can do no defer close
func SaveSqlStr ¶ added in v0.0.9
Types ¶
type IRow ¶ added in v0.0.9
type IRow interface { Set(key, val string) Get(key string) string String(key string) string Int(key string) int Int64(key string) int64 Float32(key string) float32 Float64(key string) float64 Bool(key string) bool Time(key string) int64 Byte(key string) []byte Obj(obj interface{}) bool KV() map[string]string // contains filtered or unexported methods }
type OpOption ¶ added in v0.0.9
type OpOption func(*Op)
func WithOutWhere ¶ added in v0.0.9
func WithOutWhere() OpOption
func WithWhereStr ¶ added in v0.0.9
type Properties ¶ added in v0.0.9
type Properties struct { Name string Primary bool DateTime bool Blob bool Json bool Ignore bool Table bool //table name Force bool //update ignore is zero // contains filtered or unexported fields }
func (*Properties) IsDatetime ¶ added in v0.0.9
func (this *Properties) IsDatetime() bool
日期 `sql:"datetime"`
func (*Properties) IsForce ¶ added in v0.0.9
func (this *Properties) IsForce() bool
is zero can update tablename `sql:"force"`
func (*Properties) IsIgnore ¶ added in v0.0.9
func (this *Properties) IsIgnore() bool
ignore `sql:"-"`
func (*Properties) IsPrimary ¶ added in v0.0.9
func (this *Properties) IsPrimary() bool
主键 `sql:"primary"`
func (*Properties) IsTable ¶ added in v0.0.9
func (this *Properties) IsTable() bool
tablename `sql:"table"`
type Table ¶ added in v0.0.9
type Table struct { Name string Columns []*Properties }
Click to show internal directories.
Click to hide internal directories.