Documentation ¶
Index ¶
- Variables
- func Decode(src string) string
- func Encode(src string) string
- func MsSQLOffsetLimit(offset, limit int) string
- func MsSQLTimeFormat(t interface{}) string
- func MsSQLTimeParse(s string) time.Time
- func NewStringSlice(len int, val string) []string
- func PrimaryComparator(a, b interface{}) int
- func SQLOffsetLimit(offset, limit int) string
- func SQLOrderBy(field string, revert bool) string
- func SQLWhere(conditions []string) string
- func SetCipher(c Cipher)
- func SliceJoin(objs []interface{}, sep string) string
- func StringScan(str string, v interface{}) error
- func TimeFormat(t time.Time) string
- func TimeParse(s string) time.Time
- func TimeParseLocalTime(s string) time.Time
- func TimeToLocalTime(c time.Time) string
- func ToFloat64(value interface{}) (float64, error)
- type Cipher
- type DB
- type DBQuerySession
- type DBStore
- func (store *DBStore) BeginTx(ctx context.Context) (TX, error)
- func (store *DBStore) Close() error
- func (store *DBStore) Debug(b bool)
- func (store *DBStore) Exec(sql string, args ...interface{}) (sql.Result, error)
- func (store *DBStore) Query(sql string, args ...interface{}) (*sql.Rows, error)
- func (store *DBStore) SetError(err error)
- func (store *DBStore) SlowLog(duration time.Duration)
- type DBTx
- func (tx *DBTx) BeginTx(ctx context.Context) (TX, error)
- func (tx *DBTx) Close() error
- func (tx *DBTx) Exec(sql string, args ...interface{}) (result sql.Result, err error)
- func (tx *DBTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (tx *DBTx) GetContext() context.Context
- func (tx *DBTx) Prepare(query string) (*sql.Stmt, error)
- func (tx *DBTx) Query(sql string, args ...interface{}) (result *sql.Rows, err error)
- func (tx *DBTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (tx *DBTx) QueryRow(query string, args ...interface{}) *sql.Row
- func (tx *DBTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (tx *DBTx) SetContext(ctx context.Context)
- func (tx *DBTx) SetError(err error)
- type FieldIN
- type RedisStore
- func NewRedisClient(host string, port int, password string, db int) (*RedisStore, error)
- func NewRedisClusterClient(opt *redis.ClusterOptions) (*RedisStore, error)
- func NewRedisFailoverClient(failoverOpt *redis.FailoverOptions) (*RedisStore, error)
- func NewRedisRingClient(opt *redis.RingOptions) (*RedisStore, error)
- type Set
- type TX
- type TracedDB
- type VSet
Constants ¶
This section is empty.
Variables ¶
View Source
var NoRecord = fmt.Errorf("no record found")
Functions ¶
func MsSQLOffsetLimit ¶
func MsSQLTimeFormat ¶
func MsSQLTimeFormat(t interface{}) string
func MsSQLTimeParse ¶
func NewStringSlice ¶
func PrimaryComparator ¶
func PrimaryComparator(a, b interface{}) int
func SQLOffsetLimit ¶
func SQLOrderBy ¶
func StringScan ¶
func TimeFormat ¶
func TimeParseLocalTime ¶
func TimeToLocalTime ¶
Types ¶
type DB ¶
type DBQuerySession ¶
type DBStore ¶
func NewDBStore ¶
func NewDBStoreCharset ¶
type DBTx ¶
type DBTx struct {
// contains filtered or unexported fields
}
func (*DBTx) ExecContext ¶ added in v0.9.3
func (*DBTx) GetContext ¶
func (*DBTx) QueryContext ¶ added in v0.9.3
func (*DBTx) QueryRowContext ¶ added in v0.9.3
func (*DBTx) SetContext ¶
type FieldIN ¶
type FieldIN struct { Field string Params []interface{} // contains filtered or unexported fields }
func NewFieldIN ¶
func (*FieldIN) SQLFormatNotIn ¶
type RedisStore ¶
func NewRedisClient ¶
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 Set ¶
type Set interface { // Returns a new Set that contains exactly the same elements as this set. Copy() Set // Returns the cardinality of this set. Len() int // Returns true if and only if this set contains v (according to Go equality rules). Contains(v string) bool // Inserts v into this set. Add(v string) // Removes v from this set, if it is present. Returns true if and only if v was present. Remove(v string) bool // Return All Keys ToArray() []string // Executes f(v) for every element v in this set. If f mutates this set, behavior is undefined. Do(f func(string)) // Executes f(v) once for every element v in the set, aborting if f ever returns false. If f // mutates this set, behavior is undefined. DoWhile(f func(string) bool) // Returns a channel from which each element in the set can be read exactly once. If this set // is mutated before the channel is emptied, the exact data read from the channel is undefined. Iter() <-chan string // Adds every element in s into this set. Union(s Set) // Removes every element not in s from this set. Intersect(s Set) // Removes every element in s from this set. Subtract(s Set) // Removes all elements from the set. Init() // Returns true if and only if all elements in this set are elements in s. IsSubset(s Set) bool // Returns true if and only if all elements in s are elements in this set. IsSuperset(s Set) bool // Returns true if and only if this set and s contain exactly the same elements. IsEqual(s Set) bool // Removes all elements v from this set that satisfy f(v) == true. RemoveIf(f func(string) bool) }
An unordered collection of unique elements which supports lookups, insertions, deletions, iteration, and common binary set operations. It is not guaranteed to be thread-safe.
func NewStringSet ¶
Returns a new Set pre-populated with the given items
type TX ¶
type TX interface { Close() error GetContext() context.Context Prepare(query string) (*sql.Stmt, error) QueryRow(query string, args ...interface{}) *sql.Row ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row DB }
type TracedDB ¶
type TracedDB struct { DB // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.