orm

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(src string) string

func Encode

func Encode(src string) string

func MsSQLOffsetLimit

func MsSQLOffsetLimit(offset, limit int) string

func MsSQLTimeFormat

func MsSQLTimeFormat(t interface{}) string

func MsSQLTimeParse

func MsSQLTimeParse(s string) time.Time

func NewStringSlice

func NewStringSlice(len int, val string) []string

func PrimaryComparator

func PrimaryComparator(a, b interface{}) int

func SQLOffsetLimit

func SQLOffsetLimit(offset, limit int) string

func SQLOrderBy

func SQLOrderBy(field string, revert bool) string

func SQLWhere

func SQLWhere(conditions []string) string

func SliceJoin

func SliceJoin(objs []interface{}, sep string) string

func StringScan

func StringScan(str string, v interface{}) error

func TimeFormat

func TimeFormat(t time.Time) string

func TimeParse

func TimeParse(s string) time.Time

func TimeParseLocalTime

func TimeParseLocalTime(s string) time.Time

func TimeToLocalTime

func TimeToLocalTime(c time.Time) string

func ToFloat64

func ToFloat64(value interface{}) (float64, error)

Types

type DB

type DB interface {
	Query(sql string, args ...interface{}) (*sql.Rows, error)
	Exec(sql string, args ...interface{}) (sql.Result, error)
	SetError(err error)
}

type DBStore

type DBStore struct {
	*sql.DB
	// contains filtered or unexported fields
}

func NewDBStore

func NewDBStore(driver, host string, port int, database, username, password string) (*DBStore, error)

func NewDBStoreCharset added in v1.0.3

func NewDBStoreCharset(driver, host string, port int, database, username, password, charset string) (*DBStore, error)

func (*DBStore) BeginTx

func (store *DBStore) BeginTx() (*DBTx, error)

func (*DBStore) Close

func (store *DBStore) Close() error

func (*DBStore) Debug

func (store *DBStore) Debug(b bool)

func (*DBStore) Exec

func (store *DBStore) Exec(sql string, args ...interface{}) (sql.Result, error)

func (*DBStore) Query

func (store *DBStore) Query(sql string, args ...interface{}) (*sql.Rows, error)

func (*DBStore) SetError added in v1.0.2

func (store *DBStore) SetError(err error)

func (*DBStore) SlowLog

func (store *DBStore) SlowLog(duration time.Duration)

type DBTx

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

func (*DBTx) Close

func (tx *DBTx) Close() error

func (*DBTx) Exec

func (tx *DBTx) Exec(sql string, args ...interface{}) (sql.Result, error)

func (*DBTx) Query

func (tx *DBTx) Query(sql string, args ...interface{}) (*sql.Rows, error)

func (*DBTx) SetError added in v1.0.2

func (tx *DBTx) SetError(err error)

type FieldIN added in v1.0.4

type FieldIN struct {
	Field  string
	Params []interface{}
	// contains filtered or unexported fields
}

func NewFieldIN added in v1.0.4

func NewFieldIN(field string) *FieldIN

func (*FieldIN) Add added in v1.0.4

func (in *FieldIN) Add(v interface{}) *FieldIN

func (*FieldIN) SQLFormat added in v1.0.4

func (in *FieldIN) SQLFormat() string

func (*FieldIN) SQLParams added in v1.0.4

func (in *FieldIN) SQLParams() []interface{}

type RedisStore

type RedisStore struct {
	redis.Cmdable
}

func NewRedisClient

func NewRedisClient(host string, port int, password string, db int) (*RedisStore, error)

func NewRedisClusterClient

func NewRedisClusterClient(opt *redis.ClusterOptions) (*RedisStore, error)

func NewRedisFailoverClient

func NewRedisFailoverClient(failoverOpt *redis.FailoverOptions) (*RedisStore, error)

func NewRedisRingClient

func NewRedisRingClient(opt *redis.RingOptions) (*RedisStore, error)

type VSet

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

func NewVSet

func NewVSet() *VSet

func (*VSet) Add

func (set *VSet) Add(items ...interface{})

func (*VSet) Clear

func (set *VSet) Clear()

func (*VSet) Remove

func (set *VSet) Remove(items ...string)

func (*VSet) SortAdd

func (set *VSet) SortAdd(times int, items ...interface{})

func (*VSet) Unions

func (set *VSet) Unions(offset int, limit int) []interface{}

func (*VSet) Values

func (set *VSet) Values(times int, offset int, limit int) []interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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