Documentation ¶
Index ¶
- Constants
- Variables
- func IsCacheMiss(err error) bool
- func IsMaxIdleConnections(err error) bool
- func IsTimeout(err error) bool
- type BTree
- type BoolCoder
- type BoolsCoder
- type BytesCoder
- type CacheControlConfig
- type CacheKey
- type CacheServerType
- type Coder
- type Condition
- type Conditions
- func (c *Conditions) Append(condition Condition)
- func (c *Conditions) Build(factory *ValueFactory)
- func (c *Conditions) Columns() []string
- func (c *Conditions) Current() Condition
- func (c *Conditions) Len() int
- func (c *Conditions) Next() *Conditions
- func (c *Conditions) Queries() []string
- func (c *Conditions) Release()
- func (c *Conditions) Reset()
- type Config
- type Connection
- type Decoder
- type DefaultLogger
- func (dl *DefaultLogger) Add(id string, key server.CacheKey, value LogEncoder)
- func (dl *DefaultLogger) Delete(id string, typ SLCType, key server.CacheKey)
- func (dl *DefaultLogger) DeleteFromDB(id, sql string)
- func (dl *DefaultLogger) Get(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (dl *DefaultLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)
- func (dl *DefaultLogger) GetMulti(id string, typ SLCType, key []server.CacheKey, value LogEncoder)
- func (dl *DefaultLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)
- func (dl *DefaultLogger) Set(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (dl *DefaultLogger) Update(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (dl *DefaultLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)
- func (*DefaultLogger) Warn(msg string)
- type EQCondition
- func (c *EQCondition) Build(factory *ValueFactory)
- func (c *EQCondition) Column() string
- func (c *EQCondition) Compare(value *Value) bool
- func (c *EQCondition) Query() string
- func (c *EQCondition) QueryArgs() []interface{}
- func (c *EQCondition) Release()
- func (c *EQCondition) Search(tree *BTree) []Leaf
- func (c *EQCondition) Value() *Value
- type Encoder
- type FirstLevelCache
- func (c *FirstLevelCache) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)
- func (c *FirstLevelCache) FindAll(unmarshaler Unmarshaler) error
- func (c *FirstLevelCache) FindByPrimaryKey(key *Value, unmarshaler Unmarshaler) error
- func (c *FirstLevelCache) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error
- func (c *FirstLevelCache) WarmUp(conn *sql.DB) (e error)
- type FirstLevelCacheMap
- type Float32Coder
- type Float32sCoder
- type Float64Coder
- type Float64sCoder
- type GTCondition
- func (c *GTCondition) Build(factory *ValueFactory)
- func (c *GTCondition) Column() string
- func (c *GTCondition) Compare(value *Value) bool
- func (c *GTCondition) Query() string
- func (c *GTCondition) QueryArgs() []interface{}
- func (c *GTCondition) Release()
- func (c *GTCondition) Search(tree *BTree) []Leaf
- func (c *GTCondition) Value() *Value
- type GTECondition
- func (c *GTECondition) Build(factory *ValueFactory)
- func (c *GTECondition) Column() string
- func (c *GTECondition) Compare(value *Value) bool
- func (c *GTECondition) Query() string
- func (c *GTECondition) QueryArgs() []interface{}
- func (c *GTECondition) Release()
- func (c *GTECondition) Search(tree *BTree) []Leaf
- func (c *GTECondition) Value() *Value
- type INCondition
- func (c *INCondition) Build(factory *ValueFactory)
- func (c *INCondition) Column() string
- func (c *INCondition) Compare(value *Value) bool
- func (c *INCondition) Query() string
- func (c *INCondition) QueryArgs() []interface{}
- func (c *INCondition) Release()
- func (c *INCondition) Search(tree *BTree) []Leaf
- func (c *INCondition) Value() *Value
- type Index
- type IndexType
- type Int16Coder
- type Int16sCoder
- type Int32Coder
- type Int32sCoder
- type Int64Coder
- type Int64sCoder
- type Int8Coder
- type Int8sCoder
- type IntCoder
- type IntsCoder
- type LLCConfig
- type LTCondition
- func (c *LTCondition) Build(factory *ValueFactory)
- func (c *LTCondition) Column() string
- func (c *LTCondition) Compare(value *Value) bool
- func (c *LTCondition) Query() string
- func (c *LTCondition) QueryArgs() []interface{}
- func (c *LTCondition) Release()
- func (c *LTCondition) Search(tree *BTree) []Leaf
- func (c *LTCondition) Value() *Value
- type LTECondition
- func (c *LTECondition) Build(factory *ValueFactory)
- func (c *LTECondition) Column() string
- func (c *LTECondition) Compare(value *Value) bool
- func (c *LTECondition) Query() string
- func (c *LTECondition) QueryArgs() []interface{}
- func (c *LTECondition) Release()
- func (c *LTECondition) Search(tree *BTree) []Leaf
- func (c *LTECondition) Value() *Value
- type LastLevelCache
- func (c *LastLevelCache) Create(tx *Tx, tag, key string, value Type, expiration time.Duration) error
- func (c *LastLevelCache) Delete(tx *Tx, tag, key string) error
- func (c *LastLevelCache) Find(tx *Tx, tag, key string, value Type) error
- func (c *LastLevelCache) Update(tx *Tx, tag, key string, value Type, expiration time.Duration) error
- type LastLevelCacheOption
- type Leaf
- type LockingReadOption
- type LogEncoder
- type LogMap
- type LogModeType
- type LogString
- type LogStrings
- type Logger
- type LoggerConfig
- type Marshaler
- type NEQCondition
- func (c *NEQCondition) Build(factory *ValueFactory)
- func (c *NEQCondition) Column() string
- func (c *NEQCondition) Compare(value *Value) bool
- func (c *NEQCondition) Query() string
- func (c *NEQCondition) QueryArgs() []interface{}
- func (c *NEQCondition) Release()
- func (c *NEQCondition) Search(tree *BTree) []Leaf
- func (c *NEQCondition) Value() *Value
- type Node
- type NopLogger
- func (*NopLogger) Add(id string, key server.CacheKey, value LogEncoder)
- func (*NopLogger) Delete(id string, typ SLCType, key server.CacheKey)
- func (*NopLogger) DeleteFromDB(id, sql string)
- func (*NopLogger) Get(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (*NopLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)
- func (*NopLogger) GetMulti(id string, typ SLCType, key []server.CacheKey, value LogEncoder)
- func (*NopLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)
- func (*NopLogger) Set(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (*NopLogger) Update(id string, typ SLCType, key server.CacheKey, value LogEncoder)
- func (*NopLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)
- func (*NopLogger) Warn(msg string)
- type Option
- type OptionFunc
- func LastLevelCacheExpiration(expiration time.Duration) OptionFunc
- func LastLevelCacheLockExpiration(expiration time.Duration) OptionFunc
- func LastLevelCacheOptimisticLock(enabled bool) OptionFunc
- func LastLevelCachePessimisticLock(enabled bool) OptionFunc
- func LastLevelCacheServerAddrs(addrs []string) OptionFunc
- func LastLevelCacheTagExpiration(tag string, expiration time.Duration) OptionFunc
- func LastLevelCacheTagIgnoreStash(tag string) OptionFunc
- func LastLevelCacheTagLockExpiration(tag string, expiration time.Duration) OptionFunc
- func LastLevelCacheTagOptimisticLock(tag string, enabled bool) OptionFunc
- func LastLevelCacheTagPessimisticLock(tag string, enabled bool) OptionFunc
- func LastLevelCacheTagServerAddr(tag string, serverAddr string) OptionFunc
- func LogEnabled(enabled bool) OptionFunc
- func LogMode(mode LogModeType) OptionFunc
- func LogServerAddr(addr string) OptionFunc
- func MaxIdleConnections(cons int) OptionFunc
- func MaxRetryCount(cnt int) OptionFunc
- func RetryInterval(interval time.Duration) OptionFunc
- func SecondLevelCacheExpiration(expiration time.Duration) OptionFunc
- func SecondLevelCacheLockExpiration(expiration time.Duration) OptionFunc
- func SecondLevelCacheOptimisticLock(enabled bool) OptionFunc
- func SecondLevelCachePessimisticLock(enabled bool) OptionFunc
- func SecondLevelCacheServerAddrs(addrs []string) OptionFunc
- func SecondLevelCacheTableExpiration(table string, expiration time.Duration) OptionFunc
- func SecondLevelCacheTableLockExpiration(table string, expiration time.Duration) OptionFunc
- func SecondLevelCacheTableOptimisticLock(table string, enabled bool) OptionFunc
- func SecondLevelCacheTablePessimisticLock(table string, enabled bool) OptionFunc
- func SecondLevelCacheTableServerAddr(table string, serverAddr string) OptionFunc
- func SecondLevelCacheTableShardKey(table string, shardKey string) OptionFunc
- func ServerAddrs(addrs []string) OptionFunc
- func ServerType(typ CacheServerType) OptionFunc
- func Timeout(timeout time.Duration) OptionFunc
- type OrderCondition
- type PendingQuery
- type PrimaryKeyDecoder
- type Queries
- func (q *Queries) Add(query *Query)
- func (q *Queries) At(idx int) *Query
- func (q *Queries) CacheMissQueries() []*Query
- func (q *Queries) CacheMissQueriesToSQL(typ *Struct) (string, []interface{})
- func (q *Queries) Each(iter func(*Query) error) error
- func (q *Queries) FindCacheMissQueryByStructValue(value *StructValue) *Query
- func (q *Queries) Len() int
- func (q *Queries) LoadValues(factory *ValueFactory, primaryKeyLoader func(IndexType, *QueryIterator) error, ...) (*StructSliceValue, error)
- type Query
- type QueryBuilder
- func (b *QueryBuilder) AvailableCache() bool
- func (b *QueryBuilder) AvailableIndex() bool
- func (b *QueryBuilder) Build(factory *ValueFactory)
- func (b *QueryBuilder) BuildWithIndex(factory *ValueFactory, indexes map[string]*Index, typ *Struct) (*Queries, error)
- func (b *QueryBuilder) Conditions() *Conditions
- func (b *QueryBuilder) DeleteSQL() (string, []interface{})
- func (b *QueryBuilder) Eq(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) Fields() map[string]*Value
- func (b *QueryBuilder) ForUpdate() *QueryBuilder
- func (b *QueryBuilder) Gt(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) Gte(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) In(column string, values interface{}) *QueryBuilder
- func (b *QueryBuilder) Index() string
- func (b *QueryBuilder) IsUnsupportedCacheQuery() bool
- func (b *QueryBuilder) LockInShareMode() *QueryBuilder
- func (b *QueryBuilder) Lt(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) Lte(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) Neq(column string, value interface{}) *QueryBuilder
- func (b *QueryBuilder) OrderAsc(column string) *QueryBuilder
- func (b *QueryBuilder) OrderBy(column string) *QueryBuilder
- func (b *QueryBuilder) OrderDesc(column string) *QueryBuilder
- func (b *QueryBuilder) Query() string
- func (b *QueryBuilder) Release()
- func (b *QueryBuilder) SQL(stmt string, values ...interface{}) *QueryBuilder
- func (b *QueryBuilder) SelectSQL(typ *Struct) (string, []interface{})
- func (b *QueryBuilder) UpdateSQL(updateMap map[string]interface{}) (string, []interface{})
- type QueryIterator
- func (i *QueryIterator) Error() error
- func (i *QueryIterator) Key() server.CacheKey
- func (i *QueryIterator) Next() bool
- func (i *QueryIterator) PrimaryKeys() []server.CacheKey
- func (i *QueryIterator) Query() *Query
- func (i *QueryIterator) QueryByPrimaryKey(primaryKey server.CacheKey) *Query
- func (i *QueryIterator) Reset()
- func (i *QueryIterator) SetError(err error)
- func (i *QueryIterator) SetErrorWithKey(key server.CacheKey, err error)
- func (i *QueryIterator) SetPrimaryKey(primaryKey server.CacheKey)
- func (i *QueryIterator) SetPrimaryKeyWithKey(key, primaryKey server.CacheKey)
- func (i *QueryIterator) SetPrimaryKeys(primaryKeys []server.CacheKey)
- func (i *QueryIterator) SetPrimaryKeysWithKey(key server.CacheKey, primaryKeys []server.CacheKey)
- type QueryLog
- type QueryResult
- type Rapidash
- func (r *Rapidash) AddLastLevelCacheServer(servers ...string) error
- func (r *Rapidash) AddSecondLevelCacheServer(servers ...string) error
- func (r *Rapidash) AddServers(servers ...string) error
- func (r *Rapidash) AfterCommitCallback(successCallback func(*Tx) error, failureCallback func(*Tx, []*QueryLog) error)
- func (r *Rapidash) BeforeCommitCallback(callback func(*Tx, []*QueryLog) error)
- func (r *Rapidash) Begin(conns ...Connection) (*Tx, error)
- func (r *Rapidash) Flush() error
- func (r *Rapidash) Ignore(conn *sql.DB, typ *Struct) error
- func (r *Rapidash) Recover(queries []*QueryLog) error
- func (r *Rapidash) RemoveLastLevelCacheServers(servers ...string) error
- func (r *Rapidash) RemoveSecondLevelCacheServers(servers ...string) error
- func (r *Rapidash) RemoveServers(servers ...string) error
- func (r *Rapidash) WarmUp(conn *sql.DB, typ *Struct, isReadOnly bool) error
- func (r *Rapidash) WarmUpFirstLevelCache(conn *sql.DB, typ *Struct) error
- func (r *Rapidash) WarmUpSecondLevelCache(conn *sql.DB, typ *Struct) error
- type RetryConfig
- type RuleConfig
- type SLCCommandType
- type SLCConfig
- type SLCType
- type SQLCondition
- type SecondLevelCache
- func (c *SecondLevelCache) CountByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) (uint64, error)
- func (c *SecondLevelCache) Create(ctx context.Context, tx *Tx, marshaler Marshaler) (id int64, e error)
- func (c *SecondLevelCache) CreateWithoutCache(ctx context.Context, tx *Tx, marshaler Marshaler) (id int64, e error)
- func (c *SecondLevelCache) DeleteByPrimaryKey(tx *Tx, v *Value) error
- func (c *SecondLevelCache) DeleteByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) error
- func (c *SecondLevelCache) FindByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, unmarshaler Unmarshaler) error
- func (c *SecondLevelCache) UpdateByPrimaryKey(tx *Tx, marshaler Marshaler) error
- func (c *SecondLevelCache) UpdateByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, ...) (e error)
- func (c *SecondLevelCache) WarmUp(conn *sql.DB) error
- type SecondLevelCacheMap
- type Selectors
- type Stash
- type StringCoder
- type StringsCoder
- type Struct
- func (s *Struct) Cast(coder Coder) Type
- func (s *Struct) Columns() []string
- func (s *Struct) FieldBool(column string) *Struct
- func (s *Struct) FieldBytes(column string) *Struct
- func (s *Struct) FieldFloat32(column string) *Struct
- func (s *Struct) FieldFloat64(column string) *Struct
- func (s *Struct) FieldInt(column string) *Struct
- func (s *Struct) FieldInt16(column string) *Struct
- func (s *Struct) FieldInt32(column string) *Struct
- func (s *Struct) FieldInt64(column string) *Struct
- func (s *Struct) FieldInt8(column string) *Struct
- func (s *Struct) FieldSelfStruct(column string) *Struct
- func (s *Struct) FieldSelfStructSlice(column string) *Struct
- func (s *Struct) FieldSlice(column string, typ TypeID) *Struct
- func (s *Struct) FieldString(column string) *Struct
- func (s *Struct) FieldStruct(column string, structType *Struct) *Struct
- func (s *Struct) FieldStructSlice(column string, structType *Struct) *Struct
- func (s *Struct) FieldTime(column string) *Struct
- func (s *Struct) FieldUint(column string) *Struct
- func (s *Struct) FieldUint16(column string) *Struct
- func (s *Struct) FieldUint32(column string) *Struct
- func (s *Struct) FieldUint64(column string) *Struct
- func (s *Struct) FieldUint8(column string) *Struct
- func (s *Struct) ScanValues(factory *ValueFactory) []interface{}
- func (s *Struct) StructValue(values []interface{}) *StructValue
- type StructCoder
- type StructEncoder
- func (e *StructEncoder) Bool(column string, v bool)
- func (e *StructEncoder) BoolPtr(column string, v *bool)
- func (e *StructEncoder) Bools(column string, v []bool)
- func (e *StructEncoder) Bytes(column string, v []byte)
- func (e *StructEncoder) BytesPtr(column string, v *[]byte)
- func (e *StructEncoder) Encode() ([]byte, error)
- func (e *StructEncoder) EncodeSlice() ([][]byte, error)
- func (e *StructEncoder) Error() error
- func (e *StructEncoder) Float32(column string, v float32)
- func (e *StructEncoder) Float32Ptr(column string, v *float32)
- func (e *StructEncoder) Float32s(column string, v []float32)
- func (e *StructEncoder) Float64(column string, v float64)
- func (e *StructEncoder) Float64Ptr(column string, v *float64)
- func (e *StructEncoder) Float64s(column string, v []float64)
- func (e *StructEncoder) Int(column string, v int)
- func (e *StructEncoder) Int16(column string, v int16)
- func (e *StructEncoder) Int16Ptr(column string, v *int16)
- func (e *StructEncoder) Int16s(column string, v []int16)
- func (e *StructEncoder) Int32(column string, v int32)
- func (e *StructEncoder) Int32Ptr(column string, v *int32)
- func (e *StructEncoder) Int32s(column string, v []int32)
- func (e *StructEncoder) Int64(column string, v int64)
- func (e *StructEncoder) Int64Ptr(column string, v *int64)
- func (e *StructEncoder) Int64s(column string, v []int64)
- func (e *StructEncoder) Int8(column string, v int8)
- func (e *StructEncoder) Int8Ptr(column string, v *int8)
- func (e *StructEncoder) Int8s(column string, v []int8)
- func (e *StructEncoder) IntPtr(column string, v *int)
- func (e *StructEncoder) Ints(column string, v []int)
- func (e *StructEncoder) New() Encoder
- func (e *StructEncoder) String(column string, v string)
- func (e *StructEncoder) StringPtr(column string, v *string)
- func (e *StructEncoder) Strings(column string, v []string)
- func (e *StructEncoder) Struct(column string, v Marshaler)
- func (e *StructEncoder) Structs(column string, v Marshaler)
- func (e *StructEncoder) Time(column string, v time.Time)
- func (e *StructEncoder) TimePtr(column string, v *time.Time)
- func (e *StructEncoder) Times(column string, v []time.Time)
- func (e *StructEncoder) Uint(column string, v uint)
- func (e *StructEncoder) Uint16(column string, v uint16)
- func (e *StructEncoder) Uint16Ptr(column string, v *uint16)
- func (e *StructEncoder) Uint16s(column string, v []uint16)
- func (e *StructEncoder) Uint32(column string, v uint32)
- func (e *StructEncoder) Uint32Ptr(column string, v *uint32)
- func (e *StructEncoder) Uint32s(column string, v []uint32)
- func (e *StructEncoder) Uint64(column string, v uint64)
- func (e *StructEncoder) Uint64Ptr(column string, v *uint64)
- func (e *StructEncoder) Uint64s(column string, v []uint64)
- func (e *StructEncoder) Uint8(column string, v uint8)
- func (e *StructEncoder) Uint8Ptr(column string, v *uint8)
- func (e *StructEncoder) Uint8s(column string, v []uint8)
- func (e *StructEncoder) UintPtr(column string, v *uint)
- func (e *StructEncoder) Uints(column string, v []uint)
- type StructField
- type StructSliceEncoder
- type StructSliceValue
- func (v *StructSliceValue) Append(value *StructValue)
- func (v *StructSliceValue) AppendSlice(slice *StructSliceValue)
- func (v *StructSliceValue) At(idx int) Decoder
- func (v *StructSliceValue) Bool(column string) bool
- func (v *StructSliceValue) BoolPtr(column string) *bool
- func (v *StructSliceValue) Bools(column string) []bool
- func (v *StructSliceValue) Bytes(column string) []byte
- func (v *StructSliceValue) BytesPtr(column string) *[]byte
- func (v *StructSliceValue) EncodeLog() string
- func (v *StructSliceValue) Error() error
- func (v *StructSliceValue) Filter(condition Condition) *StructSliceValue
- func (v *StructSliceValue) Float32(column string) float32
- func (v *StructSliceValue) Float32Ptr(column string) *float32
- func (v *StructSliceValue) Float32s(column string) []float32
- func (v *StructSliceValue) Float64(column string) float64
- func (v *StructSliceValue) Float64Ptr(column string) *float64
- func (v *StructSliceValue) Float64s(column string) []float64
- func (v *StructSliceValue) Int(column string) int
- func (v *StructSliceValue) Int16(column string) int16
- func (v *StructSliceValue) Int16Ptr(column string) *int16
- func (v *StructSliceValue) Int16s(column string) []int16
- func (v *StructSliceValue) Int32(column string) int32
- func (v *StructSliceValue) Int32Ptr(column string) *int32
- func (v *StructSliceValue) Int32s(column string) []int32
- func (v *StructSliceValue) Int64(column string) int64
- func (v *StructSliceValue) Int64Ptr(column string) *int64
- func (v *StructSliceValue) Int64s(column string) []int64
- func (v *StructSliceValue) Int8(column string) int8
- func (v *StructSliceValue) Int8Ptr(column string) *int8
- func (v *StructSliceValue) Int8s(column string) []int8
- func (v *StructSliceValue) IntPtr(column string) *int
- func (v *StructSliceValue) Ints(column string) []int
- func (v *StructSliceValue) Len() int
- func (v *StructSliceValue) Release()
- func (v *StructSliceValue) Slice(column string, unmarshaler Unmarshaler)
- func (v *StructSliceValue) Sort(orders []*OrderCondition)
- func (v *StructSliceValue) String(column string) string
- func (v *StructSliceValue) StringPtr(column string) *string
- func (v *StructSliceValue) Strings(column string) []string
- func (v *StructSliceValue) Struct(column string, unmarshaler Unmarshaler)
- func (v *StructSliceValue) Time(column string) time.Time
- func (v *StructSliceValue) TimePtr(column string) *time.Time
- func (v *StructSliceValue) Times(column string) []time.Time
- func (v *StructSliceValue) Uint(column string) uint
- func (v *StructSliceValue) Uint16(column string) uint16
- func (v *StructSliceValue) Uint16Ptr(column string) *uint16
- func (v *StructSliceValue) Uint16s(column string) []uint16
- func (v *StructSliceValue) Uint32(column string) uint32
- func (v *StructSliceValue) Uint32Ptr(column string) *uint32
- func (v *StructSliceValue) Uint32s(column string) []uint32
- func (v *StructSliceValue) Uint64(column string) uint64
- func (v *StructSliceValue) Uint64Ptr(column string) *uint64
- func (v *StructSliceValue) Uint64s(column string) []uint64
- func (v *StructSliceValue) Uint8(column string) uint8
- func (v *StructSliceValue) Uint8Ptr(column string) *uint8
- func (v *StructSliceValue) Uint8s(column string) []uint8
- func (v *StructSliceValue) UintPtr(column string) *uint
- func (v *StructSliceValue) Uints(column string) []uint
- type StructValue
- func (v *StructValue) At(int) Decoder
- func (v *StructValue) Bool(column string) bool
- func (v *StructValue) BoolPtr(column string) *bool
- func (v *StructValue) Bools(column string) []bool
- func (v *StructValue) Bytes(column string) []byte
- func (v *StructValue) BytesPtr(column string) *[]byte
- func (v *StructValue) EncodeLog() string
- func (v *StructValue) Error() error
- func (v *StructValue) Float32(column string) float32
- func (v *StructValue) Float32Ptr(column string) *float32
- func (v *StructValue) Float32s(column string) []float32
- func (v *StructValue) Float64(column string) float64
- func (v *StructValue) Float64Ptr(column string) *float64
- func (v *StructValue) Float64s(column string) []float64
- func (v *StructValue) Int(column string) int
- func (v *StructValue) Int16(column string) int16
- func (v *StructValue) Int16Ptr(column string) *int16
- func (v *StructValue) Int16s(column string) []int16
- func (v *StructValue) Int32(column string) int32
- func (v *StructValue) Int32Ptr(column string) *int32
- func (v *StructValue) Int32s(column string) []int32
- func (v *StructValue) Int64(column string) int64
- func (v *StructValue) Int64Ptr(column string) *int64
- func (v *StructValue) Int64s(column string) []int64
- func (v *StructValue) Int8(column string) int8
- func (v *StructValue) Int8Ptr(column string) *int8
- func (v *StructValue) Int8s(column string) []int8
- func (v *StructValue) IntPtr(column string) *int
- func (v *StructValue) Ints(column string) []int
- func (v *StructValue) Len() int
- func (v *StructValue) Release()
- func (v *StructValue) Slice(column string, unmarshaler Unmarshaler)
- func (v *StructValue) String(column string) string
- func (v *StructValue) StringPtr(column string) *string
- func (v *StructValue) Strings(column string) []string
- func (v *StructValue) Struct(column string, unmarshaler Unmarshaler)
- func (v *StructValue) Time(column string) time.Time
- func (v *StructValue) TimePtr(column string) *time.Time
- func (v *StructValue) Times(column string) []time.Time
- func (v *StructValue) Uint(column string) uint
- func (v *StructValue) Uint16(column string) uint16
- func (v *StructValue) Uint16Ptr(column string) *uint16
- func (v *StructValue) Uint16s(column string) []uint16
- func (v *StructValue) Uint32(column string) uint32
- func (v *StructValue) Uint32Ptr(column string) *uint32
- func (v *StructValue) Uint32s(column string) []uint32
- func (v *StructValue) Uint64(column string) uint64
- func (v *StructValue) Uint64Ptr(column string) *uint64
- func (v *StructValue) Uint64s(column string) []uint64
- func (v *StructValue) Uint8(column string) uint8
- func (v *StructValue) Uint8Ptr(column string) *uint8
- func (v *StructValue) Uint8s(column string) []uint8
- func (v *StructValue) UintPtr(column string) *uint
- func (v *StructValue) Uints(column string) []uint
- func (v *StructValue) ValueByColumn(column string) *Value
- type StructsCoder
- type TableConfig
- type TableOption
- type TagConfig
- type TagOption
- type TimeCoder
- type TimesCoder
- type Tx
- func (tx *Tx) AfterCommitCallback(successCallback func() error, failureCallback func([]*QueryLog) error)
- func (tx *Tx) BeforeCommitCallback(callback func([]*QueryLog) error)
- func (tx *Tx) Commit() error
- func (tx *Tx) CommitCacheOnly() error
- func (tx *Tx) CommitDBOnly() error
- func (tx *Tx) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)
- func (tx *Tx) CountByQueryBuilderContext(ctx context.Context, builder *QueryBuilder) (uint64, error)
- func (tx *Tx) Create(key string, value Type) error
- func (tx *Tx) CreateByTable(tableName string, marshaler Marshaler) (int64, error)
- func (tx *Tx) CreateByTableContext(ctx context.Context, tableName string, marshaler Marshaler) (id int64, e error)
- func (tx *Tx) CreateWithExpiration(key string, value Type, expiration time.Duration) error
- func (tx *Tx) CreateWithTag(tag, key string, value Type) error
- func (tx *Tx) CreateWithTagAndExpiration(tag, key string, value Type, expiration time.Duration) error
- func (tx *Tx) Delete(key string) error
- func (tx *Tx) DeleteByQueryBuilder(builder *QueryBuilder) error
- func (tx *Tx) DeleteByQueryBuilderContext(ctx context.Context, builder *QueryBuilder) error
- func (tx *Tx) DeleteWithTag(tag, key string) error
- func (tx *Tx) Find(key string, value Type) error
- func (tx *Tx) FindAllByTable(tableName string, unmarshaler Unmarshaler) error
- func (tx *Tx) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error
- func (tx *Tx) FindByQueryBuilderContext(ctx context.Context, builder *QueryBuilder, unmarshaler Unmarshaler) error
- func (tx *Tx) FindWithTag(tag, key string, value Type) error
- func (tx *Tx) ID() string
- func (tx *Tx) IsCommitted() bool
- func (tx *Tx) Rollback() error
- func (tx *Tx) RollbackCacheOnly() error
- func (tx *Tx) RollbackCacheOnlyUnlessCommitted() error
- func (tx *Tx) RollbackDBOnly() error
- func (tx *Tx) RollbackDBOnlyUnlessCommitted() error
- func (tx *Tx) RollbackUnlessCommitted() error
- func (tx *Tx) Update(key string, value Type) error
- func (tx *Tx) UpdateByQueryBuilder(builder *QueryBuilder, updateMap map[string]interface{}) error
- func (tx *Tx) UpdateByQueryBuilderContext(ctx context.Context, builder *QueryBuilder, updateMap map[string]interface{}) error
- func (tx *Tx) UpdateWithExpiration(key string, value Type, expiration time.Duration) error
- func (tx *Tx) UpdateWithTag(tag, key string, value Type) error
- func (tx *Tx) UpdateWithTagAndExpiration(tag, key string, value Type, expiration time.Duration) error
- type TxConnection
- type TxValue
- type Type
- type TypeID
- type TypeKind
- type Uint16Coder
- type Uint16sCoder
- type Uint32Coder
- type Uint32sCoder
- type Uint64Coder
- type Uint64sCoder
- type Uint8Coder
- type Uint8sCoder
- type UintCoder
- type UintsCoder
- type Unmarshaler
- type Value
- func NewBoolValue(v bool) *Value
- func NewBytesValue(v []byte) *Value
- func NewFloat32Value(v float32) *Value
- func NewFloat64Value(v float64) *Value
- func NewInt16Value(v int16) *Value
- func NewInt32Value(v int32) *Value
- func NewInt64Value(v int64) *Value
- func NewInt8Value(v int8) *Value
- func NewIntValue(v int) *Value
- func NewNilValue() *Value
- func NewStringValue(v string) *Value
- func NewTimeValue(v time.Time) *Value
- func NewUint16Value(v uint16) *Value
- func NewUint32Value(v uint32) *Value
- func NewUint64Value(v uint64) *Value
- func NewUint8Value(v uint8) *Value
- func NewUintValue(v uint) *Value
- func StructSliceValueToValue(v *StructSliceValue) *Value
- func StructValueToValue(v *StructValue) *Value
- func ValuesToValue(v []*Value) *Value
- type ValueDecoder
- type ValueFactory
- func (f *ValueFactory) CreateBoolPtrValue(v *bool) *Value
- func (f *ValueFactory) CreateBoolValue(v bool) *Value
- func (f *ValueFactory) CreateBytesPtrValue(v *[]byte) *Value
- func (f *ValueFactory) CreateBytesValue(v []byte) *Value
- func (f *ValueFactory) CreateDefaultValue(typ TypeID) *Value
- func (f *ValueFactory) CreateFloat32PtrValue(v *float32) *Value
- func (f *ValueFactory) CreateFloat32Value(v float32) *Value
- func (f *ValueFactory) CreateFloat64PtrValue(v *float64) *Value
- func (f *ValueFactory) CreateFloat64Value(v float64) *Value
- func (f *ValueFactory) CreateInt16PtrValue(v *int16) *Value
- func (f *ValueFactory) CreateInt16Value(v int16) *Value
- func (f *ValueFactory) CreateInt32PtrValue(v *int32) *Value
- func (f *ValueFactory) CreateInt32Value(v int32) *Value
- func (f *ValueFactory) CreateInt64PtrValue(v *int64) *Value
- func (f *ValueFactory) CreateInt64Value(v int64) *Value
- func (f *ValueFactory) CreateInt8PtrValue(v *int8) *Value
- func (f *ValueFactory) CreateInt8Value(v int8) *Value
- func (f *ValueFactory) CreateIntPtrValue(v *int) *Value
- func (f *ValueFactory) CreateIntValue(v int) *Value
- func (f *ValueFactory) CreateStringPtrValue(v *string) *Value
- func (f *ValueFactory) CreateStringValue(v string) *Value
- func (f *ValueFactory) CreateTimePtrValue(v *time.Time) *Value
- func (f *ValueFactory) CreateTimeValue(v time.Time) *Value
- func (f *ValueFactory) CreateUint16PtrValue(v *uint16) *Value
- func (f *ValueFactory) CreateUint16Value(v uint16) *Value
- func (f *ValueFactory) CreateUint32PtrValue(v *uint32) *Value
- func (f *ValueFactory) CreateUint32Value(v uint32) *Value
- func (f *ValueFactory) CreateUint64PtrValue(v *uint64) *Value
- func (f *ValueFactory) CreateUint64Value(v uint64) *Value
- func (f *ValueFactory) CreateUint8PtrValue(v *uint8) *Value
- func (f *ValueFactory) CreateUint8Value(v uint8) *Value
- func (f *ValueFactory) CreateUintPtrValue(v *uint) *Value
- func (f *ValueFactory) CreateUintValue(v uint) *Value
- func (f *ValueFactory) CreateUniqueValues(v interface{}) []*Value
- func (f *ValueFactory) CreateValue(v interface{}) *Value
- func (f *ValueFactory) CreateValueFromString(v string, typeID TypeID) (*Value, error)
- type ValueIterator
- func (i *ValueIterator) Error() error
- func (i *ValueIterator) Next() bool
- func (i *ValueIterator) PrimaryKey() server.CacheKey
- func (i *ValueIterator) QueryByPrimaryKey(factory *ValueFactory, primaryIndex *Index) (*Query, error)
- func (i *ValueIterator) Reset()
- func (i *ValueIterator) SetError(err error)
- func (i *ValueIterator) SetErrorWithKey(key server.CacheKey, err error)
- func (i *ValueIterator) SetValue(value *StructValue)
- func (i *ValueIterator) SetValueWithKey(key server.CacheKey, value *StructValue)
- func (i *ValueIterator) Value() *StructValue
- type Values
- func (v Values) At(idx int) Decoder
- func (Values) Bool(string) bool
- func (Values) BoolPtr(string) *bool
- func (Values) Bools(string) []bool
- func (Values) Bytes(string) []byte
- func (Values) BytesPtr(string) *[]byte
- func (Values) Error() error
- func (Values) Float32(string) float32
- func (Values) Float32Ptr(string) *float32
- func (Values) Float32s(string) []float32
- func (Values) Float64(string) float64
- func (Values) Float64Ptr(string) *float64
- func (Values) Float64s(string) []float64
- func (Values) Int(string) int
- func (Values) Int16(string) int16
- func (Values) Int16Ptr(string) *int16
- func (Values) Int16s(string) []int16
- func (Values) Int32(string) int32
- func (Values) Int32Ptr(string) *int32
- func (Values) Int32s(string) []int32
- func (Values) Int64(string) int64
- func (Values) Int64Ptr(string) *int64
- func (Values) Int64s(string) []int64
- func (Values) Int8(string) int8
- func (Values) Int8Ptr(string) *int8
- func (Values) Int8s(string) []int8
- func (Values) IntPtr(string) *int
- func (Values) Ints(string) []int
- func (v Values) Len() int
- func (Values) Slice(string, Unmarshaler)
- func (Values) String(string) string
- func (Values) StringPtr(string) *string
- func (Values) Strings(string) []string
- func (Values) Struct(string, Unmarshaler)
- func (Values) Time(string) time.Time
- func (Values) TimePtr(string) *time.Time
- func (Values) Times(string) []time.Time
- func (Values) Uint(string) uint
- func (Values) Uint16(string) uint16
- func (Values) Uint16Ptr(string) *uint16
- func (Values) Uint16s(string) []uint16
- func (Values) Uint32(string) uint32
- func (Values) Uint32Ptr(string) *uint32
- func (Values) Uint32s(string) []uint32
- func (Values) Uint64(string) uint64
- func (Values) Uint64Ptr(string) *uint64
- func (Values) Uint64s(string) []uint64
- func (Values) Uint8(string) uint8
- func (Values) Uint8Ptr(string) *uint8
- func (Values) Uint8s(string) []uint8
- func (Values) UintPtr(string) *uint
- func (Values) Uints(string) []uint
Constants ¶
View Source
const ( Order = 4 BranchNum = Order KeyNum = Order - 1 )
View Source
const ( CacheKeyQueryDelimiter = "&" CacheKeyQueryKeyValueDelimiter = "#" )
Variables ¶
View Source
var ( ErrBeginTransaction = xerrors.New("failed begin cache transaction. required single connection instance or nothing") ErrConnectionOfTransaction = xerrors.New("connection instance ( like sql.DB or sql.Tx ) is required for (*Rapidash).Begin()") ErrAlreadyCommittedTransaction = xerrors.New("transaction is already committed") ErrUnlockCacheKeys = xerrors.New("failed unlock cache keys") ErrCacheCommit = xerrors.New("failed cache commit") ErrCleanUpCache = xerrors.New("failed clean up cache") ErrRecoverCache = xerrors.New("failed recover cache") )
View Source
var ( ErrInvalidQuery = xerrors.New("query builder includes not equal query") ErrLookUpIndexFromQuery = xerrors.New("cannot lookup index from query") ErrMultipleINQueries = xerrors.New("multiple IN queries are not supported") ErrInvalidColumnType = xerrors.New("invalid column type") )
View Source
var ( ErrRecordNotFoundByPrimaryKey = xerrors.New("cannot find record by primary key") ErrInvalidLeafs = xerrors.New("failed to find values. ( invalid leafs )") )
View Source
var ( ErrCacheMiss = xerrors.New("cache miss hit") ErrCreatePrimaryKeyCacheBySlice = xerrors.New("cannot create cache for primary key with slice value") ErrCreateUniqueKeyCacheBySlice = xerrors.New("cannot create cache for unique key with slice value") ErrCreateCacheKeyAtMultiplePrimaryKeys = xerrors.New("cannot find by primary key because table is set multiple primary keys") )
View Source
var ( ErrScanToNilValue = xerrors.New("cannot scan to nil value") ErrUnknownColumnType = xerrors.New("unknown column type") ErrUnknownColumnName = xerrors.New("unknown column name") ErrInvalidDecodeType = xerrors.New("invalid decode type") ErrInvalidEncodeType = xerrors.New("invalid encode type") )
View Source
var (
ErrInvalidCacheKey = xerrors.New("invalid cache key")
)
Functions ¶
func IsCacheMiss ¶ added in v0.0.3
func IsMaxIdleConnections ¶ added in v0.0.3
Types ¶
type BoolsCoder ¶
type BoolsCoder struct {
// contains filtered or unexported fields
}
func Bools ¶
func Bools(v []bool) *BoolsCoder
func BoolsPtr ¶
func BoolsPtr(v *[]bool) *BoolsCoder
func (*BoolsCoder) Decode ¶
func (c *BoolsCoder) Decode(content []byte) error
func (*BoolsCoder) Encode ¶
func (c *BoolsCoder) Encode() ([]byte, error)
type BytesCoder ¶
type BytesCoder struct {
// contains filtered or unexported fields
}
func Bytes ¶
func Bytes(v []byte) *BytesCoder
func BytesPtr ¶
func BytesPtr(v *[]byte) *BytesCoder
func (*BytesCoder) Decode ¶
func (c *BytesCoder) Decode(content []byte) error
func (*BytesCoder) Encode ¶
func (c *BytesCoder) Encode() ([]byte, error)
type CacheControlConfig ¶
type CacheControlConfig struct { OptimisticLock *bool `yaml:"optimistic_lock"` PessimisticLock *bool `yaml:"pessimistic_lock"` }
func (*CacheControlConfig) LLCOptions ¶
func (cfg *CacheControlConfig) LLCOptions() []OptionFunc
func (*CacheControlConfig) SLCOptions ¶
func (cfg *CacheControlConfig) SLCOptions() []OptionFunc
func (*CacheControlConfig) TableOptions ¶
func (cfg *CacheControlConfig) TableOptions(table string) []OptionFunc
func (*CacheControlConfig) TagOptions ¶ added in v0.3.0
func (cfg *CacheControlConfig) TagOptions(tag string) []OptionFunc
type CacheKey ¶
type CacheKey struct {
// contains filtered or unexported fields
}
func (CacheKey) Type ¶
func (c CacheKey) Type() server.CacheKeyType
type CacheServerType ¶
type CacheServerType int
const ( CacheServerTypeMemcached CacheServerType = iota CacheServerTypeRedis CacheServerTypeOnMemory // DefaultTimeout is the default socket read/write timeout. DefaultTimeout = 100 * time.Millisecond // DefaultMaxIdleConns is the default maximum number of idle connections // kept for any single address. DefaultMaxIdleConns = 2 )
type Coder ¶
type Coder interface { Marshaler Unmarshaler }
type Conditions ¶
type Conditions struct {
// contains filtered or unexported fields
}
func (*Conditions) Append ¶
func (c *Conditions) Append(condition Condition)
func (*Conditions) Build ¶
func (c *Conditions) Build(factory *ValueFactory)
func (*Conditions) Columns ¶
func (c *Conditions) Columns() []string
func (*Conditions) Current ¶
func (c *Conditions) Current() Condition
func (*Conditions) Len ¶
func (c *Conditions) Len() int
func (*Conditions) Next ¶
func (c *Conditions) Next() *Conditions
func (*Conditions) Queries ¶
func (c *Conditions) Queries() []string
func (*Conditions) Release ¶
func (c *Conditions) Release()
func (*Conditions) Reset ¶
func (c *Conditions) Reset()
type Config ¶
type Config struct { Rule *RuleConfig `yaml:"rule"` SLC *SLCConfig `yaml:"slc"` LLC *LLCConfig `yaml:"llc"` }
func (*Config) Options ¶
func (cfg *Config) Options() []OptionFunc
type Connection ¶
type Decoder ¶
type Decoder interface { Len() int At(int) Decoder Int(string) int Int8(string) int8 Int16(string) int16 Int32(string) int32 Int64(string) int64 Uint(string) uint Uint8(string) uint8 Uint16(string) uint16 Uint32(string) uint32 Uint64(string) uint64 Float32(string) float32 Float64(string) float64 Bool(string) bool String(string) string Bytes(string) []byte Time(string) time.Time Slice(string, Unmarshaler) Struct(string, Unmarshaler) IntPtr(string) *int Int8Ptr(string) *int8 Int16Ptr(string) *int16 Int32Ptr(string) *int32 Int64Ptr(string) *int64 UintPtr(string) *uint Uint8Ptr(string) *uint8 Uint16Ptr(string) *uint16 Uint32Ptr(string) *uint32 Uint64Ptr(string) *uint64 Float32Ptr(string) *float32 Float64Ptr(string) *float64 BoolPtr(string) *bool StringPtr(string) *string BytesPtr(string) *[]byte TimePtr(string) *time.Time Ints(string) []int Int8s(string) []int8 Int16s(string) []int16 Int32s(string) []int32 Int64s(string) []int64 Uints(string) []uint Uint8s(string) []uint8 Uint16s(string) []uint16 Uint32s(string) []uint32 Uint64s(string) []uint64 Float32s(string) []float32 Float64s(string) []float64 Bools(string) []bool Strings(string) []string Times(string) []time.Time Error() error }
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func (*DefaultLogger) Add ¶
func (dl *DefaultLogger) Add(id string, key server.CacheKey, value LogEncoder)
func (*DefaultLogger) Delete ¶
func (dl *DefaultLogger) Delete(id string, typ SLCType, key server.CacheKey)
func (*DefaultLogger) DeleteFromDB ¶
func (dl *DefaultLogger) DeleteFromDB(id, sql string)
func (*DefaultLogger) Get ¶
func (dl *DefaultLogger) Get(id string, typ SLCType, key server.CacheKey, value LogEncoder)
func (*DefaultLogger) GetFromDB ¶
func (dl *DefaultLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)
func (*DefaultLogger) GetMulti ¶
func (dl *DefaultLogger) GetMulti(id string, typ SLCType, key []server.CacheKey, value LogEncoder)
func (*DefaultLogger) InsertIntoDB ¶
func (dl *DefaultLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)
func (*DefaultLogger) Set ¶
func (dl *DefaultLogger) Set(id string, typ SLCType, key server.CacheKey, value LogEncoder)
func (*DefaultLogger) Update ¶
func (dl *DefaultLogger) Update(id string, typ SLCType, key server.CacheKey, value LogEncoder)
func (*DefaultLogger) UpdateForDB ¶
func (dl *DefaultLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)
func (*DefaultLogger) Warn ¶
func (*DefaultLogger) Warn(msg string)
type EQCondition ¶
type EQCondition struct {
// contains filtered or unexported fields
}
func (*EQCondition) Build ¶
func (c *EQCondition) Build(factory *ValueFactory)
func (*EQCondition) Column ¶
func (c *EQCondition) Column() string
func (*EQCondition) Compare ¶
func (c *EQCondition) Compare(value *Value) bool
func (*EQCondition) Query ¶
func (c *EQCondition) Query() string
func (*EQCondition) QueryArgs ¶
func (c *EQCondition) QueryArgs() []interface{}
func (*EQCondition) Release ¶
func (c *EQCondition) Release()
func (*EQCondition) Search ¶
func (c *EQCondition) Search(tree *BTree) []Leaf
func (*EQCondition) Value ¶
func (c *EQCondition) Value() *Value
type Encoder ¶
type Encoder interface { Error() error New() Encoder Int(string, int) Int8(string, int8) Int16(string, int16) Int32(string, int32) Int64(string, int64) Uint(string, uint) Uint8(string, uint8) Uint16(string, uint16) Uint32(string, uint32) Uint64(string, uint64) Float32(string, float32) Float64(string, float64) String(string, string) Bytes(string, []byte) Bool(string, bool) Time(string, time.Time) IntPtr(string, *int) Int8Ptr(string, *int8) Int16Ptr(string, *int16) Int32Ptr(string, *int32) Int64Ptr(string, *int64) UintPtr(string, *uint) Uint8Ptr(string, *uint8) Uint16Ptr(string, *uint16) Uint32Ptr(string, *uint32) Uint64Ptr(string, *uint64) Float32Ptr(string, *float32) Float64Ptr(string, *float64) StringPtr(string, *string) BytesPtr(string, *[]byte) BoolPtr(string, *bool) TimePtr(string, *time.Time) Struct(string, Marshaler) Ints(string, []int) Int8s(string, []int8) Int16s(string, []int16) Int32s(string, []int32) Int64s(string, []int64) Uints(string, []uint) Uint8s(string, []uint8) Uint16s(string, []uint16) Uint32s(string, []uint32) Uint64s(string, []uint64) Float32s(string, []float32) Float64s(string, []float64) Strings(string, []string) Bools(string, []bool) Times(string, []time.Time) Structs(string, Marshaler) }
type FirstLevelCache ¶
type FirstLevelCache struct {
// contains filtered or unexported fields
}
func NewFirstLevelCache ¶
func NewFirstLevelCache(s *Struct) *FirstLevelCache
func (*FirstLevelCache) CountByQueryBuilder ¶
func (c *FirstLevelCache) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)
func (*FirstLevelCache) FindAll ¶
func (c *FirstLevelCache) FindAll(unmarshaler Unmarshaler) error
func (*FirstLevelCache) FindByPrimaryKey ¶
func (c *FirstLevelCache) FindByPrimaryKey(key *Value, unmarshaler Unmarshaler) error
func (*FirstLevelCache) FindByQueryBuilder ¶
func (c *FirstLevelCache) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error
type FirstLevelCacheMap ¶
func NewFirstLevelCacheMap ¶
func NewFirstLevelCacheMap() *FirstLevelCacheMap
type Float32Coder ¶
type Float32Coder struct {
// contains filtered or unexported fields
}
func Float32 ¶
func Float32(v float32) *Float32Coder
func Float32Ptr ¶
func Float32Ptr(v *float32) *Float32Coder
func (*Float32Coder) Decode ¶
func (c *Float32Coder) Decode(content []byte) error
func (*Float32Coder) Encode ¶
func (c *Float32Coder) Encode() ([]byte, error)
type Float32sCoder ¶
type Float32sCoder struct {
// contains filtered or unexported fields
}
func Float32s ¶
func Float32s(v []float32) *Float32sCoder
func Float32sPtr ¶
func Float32sPtr(v *[]float32) *Float32sCoder
func (*Float32sCoder) Decode ¶
func (c *Float32sCoder) Decode(content []byte) error
func (*Float32sCoder) Encode ¶
func (c *Float32sCoder) Encode() ([]byte, error)
type Float64Coder ¶
type Float64Coder struct {
// contains filtered or unexported fields
}
func Float64 ¶
func Float64(v float64) *Float64Coder
func Float64Ptr ¶
func Float64Ptr(v *float64) *Float64Coder
func (*Float64Coder) Decode ¶
func (c *Float64Coder) Decode(content []byte) error
func (*Float64Coder) Encode ¶
func (c *Float64Coder) Encode() ([]byte, error)
type Float64sCoder ¶
type Float64sCoder struct {
// contains filtered or unexported fields
}
func Float64s ¶
func Float64s(v []float64) *Float64sCoder
func Float64sPtr ¶
func Float64sPtr(v *[]float64) *Float64sCoder
func (*Float64sCoder) Decode ¶
func (c *Float64sCoder) Decode(content []byte) error
func (*Float64sCoder) Encode ¶
func (c *Float64sCoder) Encode() ([]byte, error)
type GTCondition ¶
type GTCondition struct {
// contains filtered or unexported fields
}
func (*GTCondition) Build ¶
func (c *GTCondition) Build(factory *ValueFactory)
func (*GTCondition) Column ¶
func (c *GTCondition) Column() string
func (*GTCondition) Compare ¶
func (c *GTCondition) Compare(value *Value) bool
func (*GTCondition) Query ¶
func (c *GTCondition) Query() string
func (*GTCondition) QueryArgs ¶
func (c *GTCondition) QueryArgs() []interface{}
func (*GTCondition) Release ¶
func (c *GTCondition) Release()
func (*GTCondition) Search ¶
func (c *GTCondition) Search(tree *BTree) []Leaf
func (*GTCondition) Value ¶
func (c *GTCondition) Value() *Value
type GTECondition ¶
type GTECondition struct {
// contains filtered or unexported fields
}
func (*GTECondition) Build ¶
func (c *GTECondition) Build(factory *ValueFactory)
func (*GTECondition) Column ¶
func (c *GTECondition) Column() string
func (*GTECondition) Compare ¶
func (c *GTECondition) Compare(value *Value) bool
func (*GTECondition) Query ¶
func (c *GTECondition) Query() string
func (*GTECondition) QueryArgs ¶
func (c *GTECondition) QueryArgs() []interface{}
func (*GTECondition) Release ¶
func (c *GTECondition) Release()
func (*GTECondition) Search ¶
func (c *GTECondition) Search(tree *BTree) []Leaf
func (*GTECondition) Value ¶
func (c *GTECondition) Value() *Value
type INCondition ¶
type INCondition struct {
// contains filtered or unexported fields
}
func (*INCondition) Build ¶
func (c *INCondition) Build(factory *ValueFactory)
func (*INCondition) Column ¶
func (c *INCondition) Column() string
func (*INCondition) Compare ¶
func (c *INCondition) Compare(value *Value) bool
func (*INCondition) Query ¶
func (c *INCondition) Query() string
func (*INCondition) QueryArgs ¶
func (c *INCondition) QueryArgs() []interface{}
func (*INCondition) Release ¶
func (c *INCondition) Release()
func (*INCondition) Search ¶
func (c *INCondition) Search(tree *BTree) []Leaf
func (*INCondition) Value ¶
func (c *INCondition) Value() *Value
type Index ¶
type Index struct { Type IndexType Table string Option *TableOption Columns []string ColumnTypeMap map[string]TypeID // contains filtered or unexported fields }
func NewPrimaryKey ¶
func NewPrimaryKey(opt *TableOption, tableName string, columns []string, typ *Struct) *Index
func NewUniqueKey ¶
func NewUniqueKey(opt *TableOption, tableName string, columns []string, typ *Struct) *Index
type Int16Coder ¶
type Int16Coder struct {
// contains filtered or unexported fields
}
func Int16 ¶
func Int16(v int16) *Int16Coder
func Int16Ptr ¶
func Int16Ptr(v *int16) *Int16Coder
func (*Int16Coder) Decode ¶
func (c *Int16Coder) Decode(content []byte) error
func (*Int16Coder) Encode ¶
func (c *Int16Coder) Encode() ([]byte, error)
type Int16sCoder ¶
type Int16sCoder struct {
// contains filtered or unexported fields
}
func Int16s ¶
func Int16s(v []int16) *Int16sCoder
func Int16sPtr ¶
func Int16sPtr(v *[]int16) *Int16sCoder
func (*Int16sCoder) Decode ¶
func (c *Int16sCoder) Decode(content []byte) error
func (*Int16sCoder) Encode ¶
func (c *Int16sCoder) Encode() ([]byte, error)
type Int32Coder ¶
type Int32Coder struct {
// contains filtered or unexported fields
}
func Int32 ¶
func Int32(v int32) *Int32Coder
func Int32Ptr ¶
func Int32Ptr(v *int32) *Int32Coder
func (*Int32Coder) Decode ¶
func (c *Int32Coder) Decode(content []byte) error
func (*Int32Coder) Encode ¶
func (c *Int32Coder) Encode() ([]byte, error)
type Int32sCoder ¶
type Int32sCoder struct {
// contains filtered or unexported fields
}
func Int32s ¶
func Int32s(v []int32) *Int32sCoder
func Int32sPtr ¶
func Int32sPtr(v *[]int32) *Int32sCoder
func (*Int32sCoder) Decode ¶
func (c *Int32sCoder) Decode(content []byte) error
func (*Int32sCoder) Encode ¶
func (c *Int32sCoder) Encode() ([]byte, error)
type Int64Coder ¶
type Int64Coder struct {
// contains filtered or unexported fields
}
func Int64 ¶
func Int64(v int64) *Int64Coder
func Int64Ptr ¶
func Int64Ptr(v *int64) *Int64Coder
func (*Int64Coder) Decode ¶
func (c *Int64Coder) Decode(content []byte) error
func (*Int64Coder) Encode ¶
func (c *Int64Coder) Encode() ([]byte, error)
type Int64sCoder ¶
type Int64sCoder struct {
// contains filtered or unexported fields
}
func Int64s ¶
func Int64s(v []int64) *Int64sCoder
func Int64sPtr ¶
func Int64sPtr(v *[]int64) *Int64sCoder
func (*Int64sCoder) Decode ¶
func (c *Int64sCoder) Decode(content []byte) error
func (*Int64sCoder) Encode ¶
func (c *Int64sCoder) Encode() ([]byte, error)
type Int8sCoder ¶
type Int8sCoder struct {
// contains filtered or unexported fields
}
func Int8s ¶
func Int8s(v []int8) *Int8sCoder
func Int8sPtr ¶
func Int8sPtr(v *[]int8) *Int8sCoder
func (*Int8sCoder) Decode ¶
func (c *Int8sCoder) Decode(content []byte) error
func (*Int8sCoder) Encode ¶
func (c *Int8sCoder) Encode() ([]byte, error)
type LLCConfig ¶
type LLCConfig struct { Servers *[]string Tags *map[string]*TagConfig `yaml:"tags"` CacheControl *CacheControlConfig `yaml:"cache_control"` Expiration *time.Duration `yaml:"expiration"` LockExpiration *time.Duration `yaml:"lock_expiration"` }
func (*LLCConfig) Options ¶
func (cfg *LLCConfig) Options() []OptionFunc
type LTCondition ¶
type LTCondition struct {
// contains filtered or unexported fields
}
func (*LTCondition) Build ¶
func (c *LTCondition) Build(factory *ValueFactory)
func (*LTCondition) Column ¶
func (c *LTCondition) Column() string
func (*LTCondition) Compare ¶
func (c *LTCondition) Compare(value *Value) bool
func (*LTCondition) Query ¶
func (c *LTCondition) Query() string
func (*LTCondition) QueryArgs ¶
func (c *LTCondition) QueryArgs() []interface{}
func (*LTCondition) Release ¶
func (c *LTCondition) Release()
func (*LTCondition) Search ¶
func (c *LTCondition) Search(tree *BTree) []Leaf
func (*LTCondition) Value ¶
func (c *LTCondition) Value() *Value
type LTECondition ¶
type LTECondition struct {
// contains filtered or unexported fields
}
func (*LTECondition) Build ¶
func (c *LTECondition) Build(factory *ValueFactory)
func (*LTECondition) Column ¶
func (c *LTECondition) Column() string
func (*LTECondition) Compare ¶
func (c *LTECondition) Compare(value *Value) bool
func (*LTECondition) Query ¶
func (c *LTECondition) Query() string
func (*LTECondition) QueryArgs ¶
func (c *LTECondition) QueryArgs() []interface{}
func (*LTECondition) Release ¶
func (c *LTECondition) Release()
func (*LTECondition) Search ¶
func (c *LTECondition) Search(tree *BTree) []Leaf
func (*LTECondition) Value ¶
func (c *LTECondition) Value() *Value
type LastLevelCache ¶
type LastLevelCache struct {
// contains filtered or unexported fields
}
func NewLastLevelCache ¶
func NewLastLevelCache(cacheServer server.CacheServer, opt *LastLevelCacheOption) *LastLevelCache
type LastLevelCacheOption ¶
type LastLevelCacheOption struct {
// contains filtered or unexported fields
}
type LockingReadOption ¶ added in v0.0.13
type LockingReadOption struct {
// contains filtered or unexported fields
}
func (*LockingReadOption) String ¶ added in v0.0.13
func (o *LockingReadOption) String() string
type LogEncoder ¶
type LogEncoder interface {
EncodeLog() string
}
type LogModeType ¶
type LogModeType int
const ( LogModeConsole LogModeType = iota LogModeJSON LogModeServerDebug )
type LogStrings ¶
func (LogStrings) EncodeLog ¶
func (l LogStrings) EncodeLog() string
type Logger ¶
type Logger interface { Warn(msg string) Add(string, server.CacheKey, LogEncoder) Get(string, SLCType, server.CacheKey, LogEncoder) GetFromDB(string, string, interface{}, LogEncoder) GetMulti(string, SLCType, []server.CacheKey, LogEncoder) Set(string, SLCType, server.CacheKey, LogEncoder) InsertIntoDB(string, string, interface{}, LogEncoder) Update(string, SLCType, server.CacheKey, LogEncoder) UpdateForDB(string, string, interface{}, LogEncoder) Delete(string, SLCType, server.CacheKey) DeleteFromDB(string, string) }
type LoggerConfig ¶
func (*LoggerConfig) Options ¶
func (cfg *LoggerConfig) Options() []OptionFunc
type NEQCondition ¶
type NEQCondition struct {
// contains filtered or unexported fields
}
func (*NEQCondition) Build ¶
func (c *NEQCondition) Build(factory *ValueFactory)
func (*NEQCondition) Column ¶
func (c *NEQCondition) Column() string
func (*NEQCondition) Compare ¶
func (c *NEQCondition) Compare(value *Value) bool
func (*NEQCondition) Query ¶
func (c *NEQCondition) Query() string
func (*NEQCondition) QueryArgs ¶
func (c *NEQCondition) QueryArgs() []interface{}
func (*NEQCondition) Release ¶
func (c *NEQCondition) Release()
func (*NEQCondition) Search ¶
func (c *NEQCondition) Search(tree *BTree) []Leaf
func (*NEQCondition) Value ¶
func (c *NEQCondition) Value() *Value
type NopLogger ¶
type NopLogger struct{}
func (*NopLogger) DeleteFromDB ¶
func (*NopLogger) GetFromDB ¶
func (*NopLogger) GetFromDB(id, sql string, args interface{}, value LogEncoder)
func (*NopLogger) InsertIntoDB ¶
func (*NopLogger) InsertIntoDB(id, sql string, args interface{}, value LogEncoder)
func (*NopLogger) UpdateForDB ¶
func (*NopLogger) UpdateForDB(id, sql string, args interface{}, value LogEncoder)
type OptionFunc ¶
type OptionFunc func(*Rapidash)
func LastLevelCacheExpiration ¶
func LastLevelCacheExpiration(expiration time.Duration) OptionFunc
func LastLevelCacheLockExpiration ¶
func LastLevelCacheLockExpiration(expiration time.Duration) OptionFunc
func LastLevelCacheOptimisticLock ¶
func LastLevelCacheOptimisticLock(enabled bool) OptionFunc
func LastLevelCachePessimisticLock ¶
func LastLevelCachePessimisticLock(enabled bool) OptionFunc
func LastLevelCacheServerAddrs ¶
func LastLevelCacheServerAddrs(addrs []string) OptionFunc
func LastLevelCacheTagExpiration ¶
func LastLevelCacheTagExpiration(tag string, expiration time.Duration) OptionFunc
func LastLevelCacheTagIgnoreStash ¶ added in v0.1.0
func LastLevelCacheTagIgnoreStash(tag string) OptionFunc
func LastLevelCacheTagLockExpiration ¶
func LastLevelCacheTagLockExpiration(tag string, expiration time.Duration) OptionFunc
func LastLevelCacheTagOptimisticLock ¶ added in v0.3.0
func LastLevelCacheTagOptimisticLock(tag string, enabled bool) OptionFunc
func LastLevelCacheTagPessimisticLock ¶ added in v0.3.0
func LastLevelCacheTagPessimisticLock(tag string, enabled bool) OptionFunc
func LastLevelCacheTagServerAddr ¶
func LastLevelCacheTagServerAddr(tag string, serverAddr string) OptionFunc
func LogEnabled ¶
func LogEnabled(enabled bool) OptionFunc
func LogMode ¶
func LogMode(mode LogModeType) OptionFunc
func LogServerAddr ¶
func LogServerAddr(addr string) OptionFunc
func MaxIdleConnections ¶
func MaxIdleConnections(cons int) OptionFunc
func MaxRetryCount ¶
func MaxRetryCount(cnt int) OptionFunc
func RetryInterval ¶
func RetryInterval(interval time.Duration) OptionFunc
func SecondLevelCacheExpiration ¶
func SecondLevelCacheExpiration(expiration time.Duration) OptionFunc
func SecondLevelCacheLockExpiration ¶
func SecondLevelCacheLockExpiration(expiration time.Duration) OptionFunc
func SecondLevelCacheOptimisticLock ¶
func SecondLevelCacheOptimisticLock(enabled bool) OptionFunc
func SecondLevelCachePessimisticLock ¶
func SecondLevelCachePessimisticLock(enabled bool) OptionFunc
func SecondLevelCacheServerAddrs ¶
func SecondLevelCacheServerAddrs(addrs []string) OptionFunc
func SecondLevelCacheTableExpiration ¶
func SecondLevelCacheTableExpiration(table string, expiration time.Duration) OptionFunc
func SecondLevelCacheTableLockExpiration ¶
func SecondLevelCacheTableLockExpiration(table string, expiration time.Duration) OptionFunc
func SecondLevelCacheTableOptimisticLock ¶
func SecondLevelCacheTableOptimisticLock(table string, enabled bool) OptionFunc
func SecondLevelCacheTablePessimisticLock ¶
func SecondLevelCacheTablePessimisticLock(table string, enabled bool) OptionFunc
func SecondLevelCacheTableServerAddr ¶
func SecondLevelCacheTableServerAddr(table string, serverAddr string) OptionFunc
func SecondLevelCacheTableShardKey ¶
func SecondLevelCacheTableShardKey(table string, shardKey string) OptionFunc
func ServerAddrs ¶
func ServerAddrs(addrs []string) OptionFunc
func ServerType ¶
func ServerType(typ CacheServerType) OptionFunc
func Timeout ¶
func Timeout(timeout time.Duration) OptionFunc
type OrderCondition ¶
type OrderCondition struct {
// contains filtered or unexported fields
}
type PendingQuery ¶
type PendingQuery struct { *QueryLog // contains filtered or unexported fields }
type PrimaryKeyDecoder ¶
type PrimaryKeyDecoder struct {
// contains filtered or unexported fields
}
func NewPrimaryKeyDecoder ¶
func NewPrimaryKeyDecoder(buf *bytes.Buffer) *PrimaryKeyDecoder
func (*PrimaryKeyDecoder) Decode ¶
func (d *PrimaryKeyDecoder) Decode() (string, error)
func (*PrimaryKeyDecoder) SetBuffer ¶
func (d *PrimaryKeyDecoder) SetBuffer(content []byte)
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CacheMissQueries ¶
func (*Queries) CacheMissQueriesToSQL ¶
func (*Queries) FindCacheMissQueryByStructValue ¶
func (q *Queries) FindCacheMissQueryByStructValue(value *StructValue) *Query
func (*Queries) LoadValues ¶
func (q *Queries) LoadValues(factory *ValueFactory, primaryKeyLoader func(IndexType, *QueryIterator) error, valueLoader func(*ValueIterator) error) (*StructSliceValue, error)
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func NewQueryBuilder ¶
func NewQueryBuilder(tableName string) *QueryBuilder
func (*QueryBuilder) AvailableCache ¶
func (b *QueryBuilder) AvailableCache() bool
func (*QueryBuilder) AvailableIndex ¶
func (b *QueryBuilder) AvailableIndex() bool
func (*QueryBuilder) Build ¶
func (b *QueryBuilder) Build(factory *ValueFactory)
func (*QueryBuilder) BuildWithIndex ¶
func (b *QueryBuilder) BuildWithIndex(factory *ValueFactory, indexes map[string]*Index, typ *Struct) (*Queries, error)
func (*QueryBuilder) Conditions ¶
func (b *QueryBuilder) Conditions() *Conditions
func (*QueryBuilder) DeleteSQL ¶
func (b *QueryBuilder) DeleteSQL() (string, []interface{})
func (*QueryBuilder) Eq ¶
func (b *QueryBuilder) Eq(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) Fields ¶
func (b *QueryBuilder) Fields() map[string]*Value
func (*QueryBuilder) ForUpdate ¶ added in v0.0.13
func (b *QueryBuilder) ForUpdate() *QueryBuilder
func (*QueryBuilder) Gt ¶
func (b *QueryBuilder) Gt(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) Gte ¶
func (b *QueryBuilder) Gte(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) In ¶
func (b *QueryBuilder) In(column string, values interface{}) *QueryBuilder
func (*QueryBuilder) Index ¶
func (b *QueryBuilder) Index() string
func (*QueryBuilder) IsUnsupportedCacheQuery ¶
func (b *QueryBuilder) IsUnsupportedCacheQuery() bool
func (*QueryBuilder) LockInShareMode ¶ added in v0.0.13
func (b *QueryBuilder) LockInShareMode() *QueryBuilder
func (*QueryBuilder) Lt ¶
func (b *QueryBuilder) Lt(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) Lte ¶
func (b *QueryBuilder) Lte(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) Neq ¶
func (b *QueryBuilder) Neq(column string, value interface{}) *QueryBuilder
func (*QueryBuilder) OrderAsc ¶
func (b *QueryBuilder) OrderAsc(column string) *QueryBuilder
func (*QueryBuilder) OrderBy ¶
func (b *QueryBuilder) OrderBy(column string) *QueryBuilder
func (*QueryBuilder) OrderDesc ¶
func (b *QueryBuilder) OrderDesc(column string) *QueryBuilder
func (*QueryBuilder) Query ¶
func (b *QueryBuilder) Query() string
func (*QueryBuilder) Release ¶
func (b *QueryBuilder) Release()
func (*QueryBuilder) SQL ¶
func (b *QueryBuilder) SQL(stmt string, values ...interface{}) *QueryBuilder
func (*QueryBuilder) SelectSQL ¶
func (b *QueryBuilder) SelectSQL(typ *Struct) (string, []interface{})
func (*QueryBuilder) UpdateSQL ¶
func (b *QueryBuilder) UpdateSQL(updateMap map[string]interface{}) (string, []interface{})
type QueryIterator ¶
type QueryIterator struct {
// contains filtered or unexported fields
}
func NewQueryIterator ¶
func NewQueryIterator(queries []*Query) *QueryIterator
func (*QueryIterator) Error ¶
func (i *QueryIterator) Error() error
func (*QueryIterator) Key ¶
func (i *QueryIterator) Key() server.CacheKey
func (*QueryIterator) Next ¶
func (i *QueryIterator) Next() bool
func (*QueryIterator) PrimaryKeys ¶
func (i *QueryIterator) PrimaryKeys() []server.CacheKey
func (*QueryIterator) Query ¶
func (i *QueryIterator) Query() *Query
func (*QueryIterator) QueryByPrimaryKey ¶
func (i *QueryIterator) QueryByPrimaryKey(primaryKey server.CacheKey) *Query
func (*QueryIterator) Reset ¶
func (i *QueryIterator) Reset()
func (*QueryIterator) SetError ¶
func (i *QueryIterator) SetError(err error)
func (*QueryIterator) SetErrorWithKey ¶
func (i *QueryIterator) SetErrorWithKey(key server.CacheKey, err error)
func (*QueryIterator) SetPrimaryKey ¶
func (i *QueryIterator) SetPrimaryKey(primaryKey server.CacheKey)
func (*QueryIterator) SetPrimaryKeyWithKey ¶
func (i *QueryIterator) SetPrimaryKeyWithKey(key, primaryKey server.CacheKey)
func (*QueryIterator) SetPrimaryKeys ¶
func (i *QueryIterator) SetPrimaryKeys(primaryKeys []server.CacheKey)
func (*QueryIterator) SetPrimaryKeysWithKey ¶
func (i *QueryIterator) SetPrimaryKeysWithKey(key server.CacheKey, primaryKeys []server.CacheKey)
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
type Rapidash ¶
type Rapidash struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...OptionFunc) (*Rapidash, error)
func (*Rapidash) AddLastLevelCacheServer ¶
func (*Rapidash) AddSecondLevelCacheServer ¶
func (*Rapidash) AddServers ¶
func (*Rapidash) AfterCommitCallback ¶
func (*Rapidash) BeforeCommitCallback ¶
func (*Rapidash) RemoveLastLevelCacheServers ¶
func (*Rapidash) RemoveSecondLevelCacheServers ¶
func (*Rapidash) RemoveServers ¶
func (*Rapidash) WarmUpFirstLevelCache ¶
type RetryConfig ¶
func (*RetryConfig) Options ¶
func (cfg *RetryConfig) Options() []OptionFunc
type RuleConfig ¶
type RuleConfig struct { Servers *[]string `yaml:"servers"` Logger *LoggerConfig `yaml:"logger"` Retry *RetryConfig `yaml:"retry"` CacheControl *CacheControlConfig `yaml:"cache_control"` Timeout *int `yaml:"timeout"` MaxIdleConnection *int `yaml:"max_idle_connection"` }
func (*RuleConfig) Options ¶
func (cfg *RuleConfig) Options() []OptionFunc
type SLCCommandType ¶
type SLCCommandType string
const ( SLCCommandGet SLCCommandType = "get" SLCCommandSet SLCCommandType = "set" SLCCommandGetMulti SLCCommandType = "get_multi" SLCCommandUpdate SLCCommandType = "update" SLCCommandDelete SLCCommandType = "delete" SLCCommandAdd SLCCommandType = "add" )
type SLCConfig ¶
type SLCConfig struct { Servers *[]string `yaml:"servers"` Tables *map[string]*TableConfig `yaml:"tables"` Expiration *time.Duration `yaml:"expiration"` LockExpiration *time.Duration `yaml:"lock_expiration"` }
func (*SLCConfig) Options ¶
func (cfg *SLCConfig) Options() []OptionFunc
type SQLCondition ¶
type SQLCondition struct {
// contains filtered or unexported fields
}
func (*SQLCondition) Build ¶
func (c *SQLCondition) Build(factory *ValueFactory)
func (*SQLCondition) Release ¶
func (c *SQLCondition) Release()
type SecondLevelCache ¶
type SecondLevelCache struct {
// contains filtered or unexported fields
}
func NewSecondLevelCache ¶
func NewSecondLevelCache(s *Struct, server server.CacheServer, opt TableOption) *SecondLevelCache
func (*SecondLevelCache) CountByQueryBuilder ¶ added in v0.0.7
func (c *SecondLevelCache) CountByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) (uint64, error)
func (*SecondLevelCache) CreateWithoutCache ¶
func (*SecondLevelCache) DeleteByPrimaryKey ¶
func (c *SecondLevelCache) DeleteByPrimaryKey(tx *Tx, v *Value) error
func (*SecondLevelCache) DeleteByQueryBuilder ¶
func (c *SecondLevelCache) DeleteByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder) error
func (*SecondLevelCache) FindByQueryBuilder ¶
func (c *SecondLevelCache) FindByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, unmarshaler Unmarshaler) error
func (*SecondLevelCache) UpdateByPrimaryKey ¶
func (c *SecondLevelCache) UpdateByPrimaryKey(tx *Tx, marshaler Marshaler) error
func (*SecondLevelCache) UpdateByQueryBuilder ¶
func (c *SecondLevelCache) UpdateByQueryBuilder(ctx context.Context, tx *Tx, builder *QueryBuilder, updateMap map[string]interface{}) (e error)
type SecondLevelCacheMap ¶
func NewSecondLevelCacheMap ¶
func NewSecondLevelCacheMap() *SecondLevelCacheMap
type StringCoder ¶
type StringCoder struct {
// contains filtered or unexported fields
}
func String ¶
func String(v string) *StringCoder
func StringPtr ¶
func StringPtr(v *string) *StringCoder
func (*StringCoder) Decode ¶
func (c *StringCoder) Decode(content []byte) error
func (*StringCoder) Encode ¶
func (c *StringCoder) Encode() ([]byte, error)
type StringsCoder ¶
type StringsCoder struct {
// contains filtered or unexported fields
}
func Strings ¶
func Strings(v []string) *StringsCoder
func StringsPtr ¶
func StringsPtr(v *[]string) *StringsCoder
func (*StringsCoder) Decode ¶
func (c *StringsCoder) Decode(content []byte) error
func (*StringsCoder) Encode ¶
func (c *StringsCoder) Encode() ([]byte, error)
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
func (*Struct) FieldBytes ¶
func (*Struct) FieldFloat32 ¶
func (*Struct) FieldFloat64 ¶
func (*Struct) FieldInt16 ¶
func (*Struct) FieldInt32 ¶
func (*Struct) FieldInt64 ¶
func (*Struct) FieldSelfStruct ¶
func (*Struct) FieldSelfStructSlice ¶
func (*Struct) FieldString ¶
func (*Struct) FieldStruct ¶
func (*Struct) FieldStructSlice ¶
func (*Struct) FieldUint16 ¶
func (*Struct) FieldUint32 ¶
func (*Struct) FieldUint64 ¶
func (*Struct) FieldUint8 ¶
func (*Struct) ScanValues ¶
func (s *Struct) ScanValues(factory *ValueFactory) []interface{}
func (*Struct) StructValue ¶
func (s *Struct) StructValue(values []interface{}) *StructValue
type StructCoder ¶
type StructCoder struct {
// contains filtered or unexported fields
}
func (*StructCoder) Decode ¶
func (c *StructCoder) Decode(content []byte) error
func (*StructCoder) Encode ¶
func (c *StructCoder) Encode() ([]byte, error)
type StructEncoder ¶
type StructEncoder struct {
// contains filtered or unexported fields
}
func NewStructEncoder ¶
func NewStructEncoder(s *Struct, factory *ValueFactory) *StructEncoder
func (*StructEncoder) Bool ¶
func (e *StructEncoder) Bool(column string, v bool)
func (*StructEncoder) BoolPtr ¶
func (e *StructEncoder) BoolPtr(column string, v *bool)
func (*StructEncoder) Bools ¶
func (e *StructEncoder) Bools(column string, v []bool)
func (*StructEncoder) Bytes ¶
func (e *StructEncoder) Bytes(column string, v []byte)
func (*StructEncoder) BytesPtr ¶
func (e *StructEncoder) BytesPtr(column string, v *[]byte)
func (*StructEncoder) Encode ¶
func (e *StructEncoder) Encode() ([]byte, error)
func (*StructEncoder) EncodeSlice ¶
func (e *StructEncoder) EncodeSlice() ([][]byte, error)
func (*StructEncoder) Error ¶
func (e *StructEncoder) Error() error
func (*StructEncoder) Float32 ¶
func (e *StructEncoder) Float32(column string, v float32)
func (*StructEncoder) Float32Ptr ¶
func (e *StructEncoder) Float32Ptr(column string, v *float32)
func (*StructEncoder) Float32s ¶
func (e *StructEncoder) Float32s(column string, v []float32)
func (*StructEncoder) Float64 ¶
func (e *StructEncoder) Float64(column string, v float64)
func (*StructEncoder) Float64Ptr ¶
func (e *StructEncoder) Float64Ptr(column string, v *float64)
func (*StructEncoder) Float64s ¶
func (e *StructEncoder) Float64s(column string, v []float64)
func (*StructEncoder) Int ¶
func (e *StructEncoder) Int(column string, v int)
func (*StructEncoder) Int16 ¶
func (e *StructEncoder) Int16(column string, v int16)
func (*StructEncoder) Int16Ptr ¶
func (e *StructEncoder) Int16Ptr(column string, v *int16)
func (*StructEncoder) Int16s ¶
func (e *StructEncoder) Int16s(column string, v []int16)
func (*StructEncoder) Int32 ¶
func (e *StructEncoder) Int32(column string, v int32)
func (*StructEncoder) Int32Ptr ¶
func (e *StructEncoder) Int32Ptr(column string, v *int32)
func (*StructEncoder) Int32s ¶
func (e *StructEncoder) Int32s(column string, v []int32)
func (*StructEncoder) Int64 ¶
func (e *StructEncoder) Int64(column string, v int64)
func (*StructEncoder) Int64Ptr ¶
func (e *StructEncoder) Int64Ptr(column string, v *int64)
func (*StructEncoder) Int64s ¶
func (e *StructEncoder) Int64s(column string, v []int64)
func (*StructEncoder) Int8 ¶
func (e *StructEncoder) Int8(column string, v int8)
func (*StructEncoder) Int8Ptr ¶
func (e *StructEncoder) Int8Ptr(column string, v *int8)
func (*StructEncoder) Int8s ¶
func (e *StructEncoder) Int8s(column string, v []int8)
func (*StructEncoder) IntPtr ¶
func (e *StructEncoder) IntPtr(column string, v *int)
func (*StructEncoder) Ints ¶
func (e *StructEncoder) Ints(column string, v []int)
func (*StructEncoder) New ¶
func (e *StructEncoder) New() Encoder
func (*StructEncoder) String ¶
func (e *StructEncoder) String(column string, v string)
func (*StructEncoder) StringPtr ¶
func (e *StructEncoder) StringPtr(column string, v *string)
func (*StructEncoder) Strings ¶
func (e *StructEncoder) Strings(column string, v []string)
func (*StructEncoder) Struct ¶
func (e *StructEncoder) Struct(column string, v Marshaler)
func (*StructEncoder) Structs ¶
func (e *StructEncoder) Structs(column string, v Marshaler)
func (*StructEncoder) Uint ¶
func (e *StructEncoder) Uint(column string, v uint)
func (*StructEncoder) Uint16 ¶
func (e *StructEncoder) Uint16(column string, v uint16)
func (*StructEncoder) Uint16Ptr ¶
func (e *StructEncoder) Uint16Ptr(column string, v *uint16)
func (*StructEncoder) Uint16s ¶
func (e *StructEncoder) Uint16s(column string, v []uint16)
func (*StructEncoder) Uint32 ¶
func (e *StructEncoder) Uint32(column string, v uint32)
func (*StructEncoder) Uint32Ptr ¶
func (e *StructEncoder) Uint32Ptr(column string, v *uint32)
func (*StructEncoder) Uint32s ¶
func (e *StructEncoder) Uint32s(column string, v []uint32)
func (*StructEncoder) Uint64 ¶
func (e *StructEncoder) Uint64(column string, v uint64)
func (*StructEncoder) Uint64Ptr ¶
func (e *StructEncoder) Uint64Ptr(column string, v *uint64)
func (*StructEncoder) Uint64s ¶
func (e *StructEncoder) Uint64s(column string, v []uint64)
func (*StructEncoder) Uint8 ¶
func (e *StructEncoder) Uint8(column string, v uint8)
func (*StructEncoder) Uint8Ptr ¶
func (e *StructEncoder) Uint8Ptr(column string, v *uint8)
func (*StructEncoder) Uint8s ¶
func (e *StructEncoder) Uint8s(column string, v []uint8)
func (*StructEncoder) UintPtr ¶
func (e *StructEncoder) UintPtr(column string, v *uint)
func (*StructEncoder) Uints ¶
func (e *StructEncoder) Uints(column string, v []uint)
type StructField ¶
type StructField struct {
// contains filtered or unexported fields
}
func (*StructField) ScanValue ¶
func (sf *StructField) ScanValue(factory *ValueFactory) *Value
type StructSliceEncoder ¶
type StructSliceEncoder struct { *StructEncoder // contains filtered or unexported fields }
func NewStructSliceEncoder ¶
func NewStructSliceEncoder(typ *Struct, valueFactory *ValueFactory, coder Coder) *StructSliceEncoder
func (*StructSliceEncoder) Encode ¶
func (e *StructSliceEncoder) Encode() ([]byte, error)
type StructSliceValue ¶
type StructSliceValue struct {
// contains filtered or unexported fields
}
func NewStructSliceValue ¶
func NewStructSliceValue() *StructSliceValue
func (*StructSliceValue) Append ¶
func (v *StructSliceValue) Append(value *StructValue)
func (*StructSliceValue) AppendSlice ¶
func (v *StructSliceValue) AppendSlice(slice *StructSliceValue)
func (*StructSliceValue) At ¶
func (v *StructSliceValue) At(idx int) Decoder
func (*StructSliceValue) Bool ¶
func (v *StructSliceValue) Bool(column string) bool
func (*StructSliceValue) BoolPtr ¶
func (v *StructSliceValue) BoolPtr(column string) *bool
func (*StructSliceValue) Bools ¶
func (v *StructSliceValue) Bools(column string) []bool
func (*StructSliceValue) Bytes ¶
func (v *StructSliceValue) Bytes(column string) []byte
func (*StructSliceValue) BytesPtr ¶
func (v *StructSliceValue) BytesPtr(column string) *[]byte
func (*StructSliceValue) EncodeLog ¶
func (v *StructSliceValue) EncodeLog() string
func (*StructSliceValue) Error ¶
func (v *StructSliceValue) Error() error
func (*StructSliceValue) Filter ¶
func (v *StructSliceValue) Filter(condition Condition) *StructSliceValue
func (*StructSliceValue) Float32 ¶
func (v *StructSliceValue) Float32(column string) float32
func (*StructSliceValue) Float32Ptr ¶
func (v *StructSliceValue) Float32Ptr(column string) *float32
func (*StructSliceValue) Float32s ¶
func (v *StructSliceValue) Float32s(column string) []float32
func (*StructSliceValue) Float64 ¶
func (v *StructSliceValue) Float64(column string) float64
func (*StructSliceValue) Float64Ptr ¶
func (v *StructSliceValue) Float64Ptr(column string) *float64
func (*StructSliceValue) Float64s ¶
func (v *StructSliceValue) Float64s(column string) []float64
func (*StructSliceValue) Int ¶
func (v *StructSliceValue) Int(column string) int
func (*StructSliceValue) Int16 ¶
func (v *StructSliceValue) Int16(column string) int16
func (*StructSliceValue) Int16Ptr ¶
func (v *StructSliceValue) Int16Ptr(column string) *int16
func (*StructSliceValue) Int16s ¶
func (v *StructSliceValue) Int16s(column string) []int16
func (*StructSliceValue) Int32 ¶
func (v *StructSliceValue) Int32(column string) int32
func (*StructSliceValue) Int32Ptr ¶
func (v *StructSliceValue) Int32Ptr(column string) *int32
func (*StructSliceValue) Int32s ¶
func (v *StructSliceValue) Int32s(column string) []int32
func (*StructSliceValue) Int64 ¶
func (v *StructSliceValue) Int64(column string) int64
func (*StructSliceValue) Int64Ptr ¶
func (v *StructSliceValue) Int64Ptr(column string) *int64
func (*StructSliceValue) Int64s ¶
func (v *StructSliceValue) Int64s(column string) []int64
func (*StructSliceValue) Int8 ¶
func (v *StructSliceValue) Int8(column string) int8
func (*StructSliceValue) Int8Ptr ¶
func (v *StructSliceValue) Int8Ptr(column string) *int8
func (*StructSliceValue) Int8s ¶
func (v *StructSliceValue) Int8s(column string) []int8
func (*StructSliceValue) IntPtr ¶
func (v *StructSliceValue) IntPtr(column string) *int
func (*StructSliceValue) Ints ¶
func (v *StructSliceValue) Ints(column string) []int
func (*StructSliceValue) Len ¶
func (v *StructSliceValue) Len() int
func (*StructSliceValue) Release ¶
func (v *StructSliceValue) Release()
func (*StructSliceValue) Slice ¶
func (v *StructSliceValue) Slice(column string, unmarshaler Unmarshaler)
func (*StructSliceValue) Sort ¶
func (v *StructSliceValue) Sort(orders []*OrderCondition)
func (*StructSliceValue) String ¶
func (v *StructSliceValue) String(column string) string
func (*StructSliceValue) StringPtr ¶
func (v *StructSliceValue) StringPtr(column string) *string
func (*StructSliceValue) Strings ¶
func (v *StructSliceValue) Strings(column string) []string
func (*StructSliceValue) Struct ¶
func (v *StructSliceValue) Struct(column string, unmarshaler Unmarshaler)
func (*StructSliceValue) Uint ¶
func (v *StructSliceValue) Uint(column string) uint
func (*StructSliceValue) Uint16 ¶
func (v *StructSliceValue) Uint16(column string) uint16
func (*StructSliceValue) Uint16Ptr ¶
func (v *StructSliceValue) Uint16Ptr(column string) *uint16
func (*StructSliceValue) Uint16s ¶
func (v *StructSliceValue) Uint16s(column string) []uint16
func (*StructSliceValue) Uint32 ¶
func (v *StructSliceValue) Uint32(column string) uint32
func (*StructSliceValue) Uint32Ptr ¶
func (v *StructSliceValue) Uint32Ptr(column string) *uint32
func (*StructSliceValue) Uint32s ¶
func (v *StructSliceValue) Uint32s(column string) []uint32
func (*StructSliceValue) Uint64 ¶
func (v *StructSliceValue) Uint64(column string) uint64
func (*StructSliceValue) Uint64Ptr ¶
func (v *StructSliceValue) Uint64Ptr(column string) *uint64
func (*StructSliceValue) Uint64s ¶
func (v *StructSliceValue) Uint64s(column string) []uint64
func (*StructSliceValue) Uint8 ¶
func (v *StructSliceValue) Uint8(column string) uint8
func (*StructSliceValue) Uint8Ptr ¶
func (v *StructSliceValue) Uint8Ptr(column string) *uint8
func (*StructSliceValue) Uint8s ¶
func (v *StructSliceValue) Uint8s(column string) []uint8
func (*StructSliceValue) UintPtr ¶
func (v *StructSliceValue) UintPtr(column string) *uint
func (*StructSliceValue) Uints ¶
func (v *StructSliceValue) Uints(column string) []uint
type StructValue ¶
type StructValue struct {
// contains filtered or unexported fields
}
func (*StructValue) At ¶
func (v *StructValue) At(int) Decoder
func (*StructValue) Bool ¶
func (v *StructValue) Bool(column string) bool
func (*StructValue) BoolPtr ¶
func (v *StructValue) BoolPtr(column string) *bool
func (*StructValue) Bools ¶
func (v *StructValue) Bools(column string) []bool
func (*StructValue) Bytes ¶
func (v *StructValue) Bytes(column string) []byte
func (*StructValue) BytesPtr ¶
func (v *StructValue) BytesPtr(column string) *[]byte
func (*StructValue) EncodeLog ¶
func (v *StructValue) EncodeLog() string
func (*StructValue) Error ¶
func (v *StructValue) Error() error
func (*StructValue) Float32 ¶
func (v *StructValue) Float32(column string) float32
func (*StructValue) Float32Ptr ¶
func (v *StructValue) Float32Ptr(column string) *float32
func (*StructValue) Float32s ¶
func (v *StructValue) Float32s(column string) []float32
func (*StructValue) Float64 ¶
func (v *StructValue) Float64(column string) float64
func (*StructValue) Float64Ptr ¶
func (v *StructValue) Float64Ptr(column string) *float64
func (*StructValue) Float64s ¶
func (v *StructValue) Float64s(column string) []float64
func (*StructValue) Int ¶
func (v *StructValue) Int(column string) int
func (*StructValue) Int16 ¶
func (v *StructValue) Int16(column string) int16
func (*StructValue) Int16Ptr ¶
func (v *StructValue) Int16Ptr(column string) *int16
func (*StructValue) Int16s ¶
func (v *StructValue) Int16s(column string) []int16
func (*StructValue) Int32 ¶
func (v *StructValue) Int32(column string) int32
func (*StructValue) Int32Ptr ¶
func (v *StructValue) Int32Ptr(column string) *int32
func (*StructValue) Int32s ¶
func (v *StructValue) Int32s(column string) []int32
func (*StructValue) Int64 ¶
func (v *StructValue) Int64(column string) int64
func (*StructValue) Int64Ptr ¶
func (v *StructValue) Int64Ptr(column string) *int64
func (*StructValue) Int64s ¶
func (v *StructValue) Int64s(column string) []int64
func (*StructValue) Int8 ¶
func (v *StructValue) Int8(column string) int8
func (*StructValue) Int8Ptr ¶
func (v *StructValue) Int8Ptr(column string) *int8
func (*StructValue) Int8s ¶
func (v *StructValue) Int8s(column string) []int8
func (*StructValue) IntPtr ¶
func (v *StructValue) IntPtr(column string) *int
func (*StructValue) Ints ¶
func (v *StructValue) Ints(column string) []int
func (*StructValue) Len ¶
func (v *StructValue) Len() int
func (*StructValue) Release ¶
func (v *StructValue) Release()
func (*StructValue) Slice ¶
func (v *StructValue) Slice(column string, unmarshaler Unmarshaler)
func (*StructValue) String ¶
func (v *StructValue) String(column string) string
func (*StructValue) StringPtr ¶
func (v *StructValue) StringPtr(column string) *string
func (*StructValue) Strings ¶
func (v *StructValue) Strings(column string) []string
func (*StructValue) Struct ¶
func (v *StructValue) Struct(column string, unmarshaler Unmarshaler)
func (*StructValue) Uint ¶
func (v *StructValue) Uint(column string) uint
func (*StructValue) Uint16 ¶
func (v *StructValue) Uint16(column string) uint16
func (*StructValue) Uint16Ptr ¶
func (v *StructValue) Uint16Ptr(column string) *uint16
func (*StructValue) Uint16s ¶
func (v *StructValue) Uint16s(column string) []uint16
func (*StructValue) Uint32 ¶
func (v *StructValue) Uint32(column string) uint32
func (*StructValue) Uint32Ptr ¶
func (v *StructValue) Uint32Ptr(column string) *uint32
func (*StructValue) Uint32s ¶
func (v *StructValue) Uint32s(column string) []uint32
func (*StructValue) Uint64 ¶
func (v *StructValue) Uint64(column string) uint64
func (*StructValue) Uint64Ptr ¶
func (v *StructValue) Uint64Ptr(column string) *uint64
func (*StructValue) Uint64s ¶
func (v *StructValue) Uint64s(column string) []uint64
func (*StructValue) Uint8 ¶
func (v *StructValue) Uint8(column string) uint8
func (*StructValue) Uint8Ptr ¶
func (v *StructValue) Uint8Ptr(column string) *uint8
func (*StructValue) Uint8s ¶
func (v *StructValue) Uint8s(column string) []uint8
func (*StructValue) UintPtr ¶
func (v *StructValue) UintPtr(column string) *uint
func (*StructValue) Uints ¶
func (v *StructValue) Uints(column string) []uint
func (*StructValue) ValueByColumn ¶
func (v *StructValue) ValueByColumn(column string) *Value
type StructsCoder ¶
type StructsCoder struct {
// contains filtered or unexported fields
}
func Structs ¶
func Structs(v Coder, typ *Struct) *StructsCoder
func StructsPtr ¶
func StructsPtr(v Coder, typ *Struct) *StructsCoder
func (*StructsCoder) Decode ¶
func (c *StructsCoder) Decode(content []byte) error
func (*StructsCoder) Encode ¶
func (c *StructsCoder) Encode() ([]byte, error)
type TableConfig ¶
type TableConfig struct { ShardKey *string `yaml:"shard_key"` Server *string `yaml:"server"` CacheControl *CacheControlConfig `yaml:"cache_control"` Expiration *time.Duration `yaml:"expiration"` LockExpiration *time.Duration `yaml:"lock_expiration"` }
func (*TableConfig) Options ¶
func (cfg *TableConfig) Options(table string) []OptionFunc
type TableOption ¶
type TableOption struct {
// contains filtered or unexported fields
}
func (*TableOption) Expiration ¶
func (o *TableOption) Expiration() time.Duration
func (*TableOption) LockExpiration ¶
func (o *TableOption) LockExpiration() time.Duration
func (*TableOption) OptimisticLock ¶
func (o *TableOption) OptimisticLock() bool
func (*TableOption) PessimisticLock ¶
func (o *TableOption) PessimisticLock() bool
func (*TableOption) Server ¶
func (o *TableOption) Server() string
func (*TableOption) ShardKey ¶
func (o *TableOption) ShardKey() string
type TagConfig ¶
type TagConfig struct { Server *string `yaml:"server"` CacheControl *CacheControlConfig `yaml:"cache_control"` Expiration *time.Duration `yaml:"expiration"` LockExpiration *time.Duration `yaml:"lock_expiration"` }
func (*TagConfig) Options ¶
func (cfg *TagConfig) Options(tag string) []OptionFunc
type TimesCoder ¶
type TimesCoder struct {
// contains filtered or unexported fields
}
func Times ¶
func Times(v []time.Time) *TimesCoder
func TimesPtr ¶
func TimesPtr(v *[]time.Time) *TimesCoder
func (*TimesCoder) Decode ¶
func (c *TimesCoder) Decode(content []byte) error
func (*TimesCoder) Encode ¶
func (c *TimesCoder) Encode() ([]byte, error)
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
func (*Tx) AfterCommitCallback ¶ added in v0.0.9
func (*Tx) BeforeCommitCallback ¶ added in v0.0.9
func (*Tx) CommitCacheOnly ¶
func (*Tx) CommitDBOnly ¶
func (*Tx) CountByQueryBuilder ¶
func (tx *Tx) CountByQueryBuilder(builder *QueryBuilder) (uint64, error)
func (*Tx) CountByQueryBuilderContext ¶ added in v0.0.7
func (*Tx) CreateByTable ¶
func (*Tx) CreateByTableContext ¶
func (*Tx) CreateWithExpiration ¶
func (*Tx) CreateWithTagAndExpiration ¶
func (*Tx) DeleteByQueryBuilder ¶
func (tx *Tx) DeleteByQueryBuilder(builder *QueryBuilder) error
func (*Tx) DeleteByQueryBuilderContext ¶
func (tx *Tx) DeleteByQueryBuilderContext(ctx context.Context, builder *QueryBuilder) error
func (*Tx) DeleteWithTag ¶
func (*Tx) FindAllByTable ¶
func (tx *Tx) FindAllByTable(tableName string, unmarshaler Unmarshaler) error
func (*Tx) FindByQueryBuilder ¶
func (tx *Tx) FindByQueryBuilder(builder *QueryBuilder, unmarshaler Unmarshaler) error
func (*Tx) FindByQueryBuilderContext ¶
func (tx *Tx) FindByQueryBuilderContext(ctx context.Context, builder *QueryBuilder, unmarshaler Unmarshaler) error
func (*Tx) IsCommitted ¶ added in v0.0.6
func (*Tx) RollbackCacheOnly ¶
func (*Tx) RollbackCacheOnlyUnlessCommitted ¶
func (*Tx) RollbackDBOnly ¶
func (*Tx) RollbackDBOnlyUnlessCommitted ¶
func (*Tx) RollbackUnlessCommitted ¶
func (*Tx) UpdateByQueryBuilder ¶
func (tx *Tx) UpdateByQueryBuilder(builder *QueryBuilder, updateMap map[string]interface{}) error
func (*Tx) UpdateByQueryBuilderContext ¶
func (*Tx) UpdateWithExpiration ¶
type TxConnection ¶
type TxConnection interface { Connection Commit() error Rollback() error }
type Uint16Coder ¶
type Uint16Coder struct {
// contains filtered or unexported fields
}
func Uint16 ¶
func Uint16(v uint16) *Uint16Coder
func Uint16Ptr ¶
func Uint16Ptr(v *uint16) *Uint16Coder
func (*Uint16Coder) Decode ¶
func (c *Uint16Coder) Decode(content []byte) error
func (*Uint16Coder) Encode ¶
func (c *Uint16Coder) Encode() ([]byte, error)
type Uint16sCoder ¶
type Uint16sCoder struct {
// contains filtered or unexported fields
}
func Uint16s ¶
func Uint16s(v []uint16) *Uint16sCoder
func Uint16sPtr ¶
func Uint16sPtr(v *[]uint16) *Uint16sCoder
func (*Uint16sCoder) Decode ¶
func (c *Uint16sCoder) Decode(content []byte) error
func (*Uint16sCoder) Encode ¶
func (c *Uint16sCoder) Encode() ([]byte, error)
type Uint32Coder ¶
type Uint32Coder struct {
// contains filtered or unexported fields
}
func Uint32 ¶
func Uint32(v uint32) *Uint32Coder
func Uint32Ptr ¶
func Uint32Ptr(v *uint32) *Uint32Coder
func (*Uint32Coder) Decode ¶
func (c *Uint32Coder) Decode(content []byte) error
func (*Uint32Coder) Encode ¶
func (c *Uint32Coder) Encode() ([]byte, error)
type Uint32sCoder ¶
type Uint32sCoder struct {
// contains filtered or unexported fields
}
func Uint32s ¶
func Uint32s(v []uint32) *Uint32sCoder
func Uint32sPtr ¶
func Uint32sPtr(v *[]uint32) *Uint32sCoder
func (*Uint32sCoder) Decode ¶
func (c *Uint32sCoder) Decode(content []byte) error
func (*Uint32sCoder) Encode ¶
func (c *Uint32sCoder) Encode() ([]byte, error)
type Uint64Coder ¶
type Uint64Coder struct {
// contains filtered or unexported fields
}
func Uint64 ¶
func Uint64(v uint64) *Uint64Coder
func Uint64Ptr ¶
func Uint64Ptr(v *uint64) *Uint64Coder
func (*Uint64Coder) Decode ¶
func (c *Uint64Coder) Decode(content []byte) error
func (*Uint64Coder) Encode ¶
func (c *Uint64Coder) Encode() ([]byte, error)
type Uint64sCoder ¶
type Uint64sCoder struct {
// contains filtered or unexported fields
}
func Uint64s ¶
func Uint64s(v []uint64) *Uint64sCoder
func Uint64sPtr ¶
func Uint64sPtr(v *[]uint64) *Uint64sCoder
func (*Uint64sCoder) Decode ¶
func (c *Uint64sCoder) Decode(content []byte) error
func (*Uint64sCoder) Encode ¶
func (c *Uint64sCoder) Encode() ([]byte, error)
type Uint8Coder ¶
type Uint8Coder struct {
// contains filtered or unexported fields
}
func Uint8 ¶
func Uint8(v uint8) *Uint8Coder
func Uint8Ptr ¶
func Uint8Ptr(v *uint8) *Uint8Coder
func (*Uint8Coder) Decode ¶
func (c *Uint8Coder) Decode(content []byte) error
func (*Uint8Coder) Encode ¶
func (c *Uint8Coder) Encode() ([]byte, error)
type Uint8sCoder ¶
type Uint8sCoder struct {
// contains filtered or unexported fields
}
func Uint8s ¶
func Uint8s(v []uint8) *Uint8sCoder
func Uint8sPtr ¶
func Uint8sPtr(v *[]uint8) *Uint8sCoder
func (*Uint8sCoder) Decode ¶
func (c *Uint8sCoder) Decode(content []byte) error
func (*Uint8sCoder) Encode ¶
func (c *Uint8sCoder) Encode() ([]byte, error)
type UintsCoder ¶
type UintsCoder struct {
// contains filtered or unexported fields
}
func Uints ¶
func Uints(v []uint) *UintsCoder
func UintsPtr ¶
func UintsPtr(v *[]uint) *UintsCoder
func (*UintsCoder) Decode ¶
func (c *UintsCoder) Decode(content []byte) error
func (*UintsCoder) Encode ¶
func (c *UintsCoder) Encode() ([]byte, error)
type Unmarshaler ¶
type Value ¶
type Value struct { IsNil bool Set func(interface{}) EQ func(*Value) bool NEQ func(*Value) bool LT func(*Value) bool LTE func(*Value) bool GT func(*Value) bool GTE func(*Value) bool String func() string Hash func() uint32 RawValue func() interface{} // contains filtered or unexported fields }
func NewBoolValue ¶
func NewBytesValue ¶
func NewFloat32Value ¶
func NewFloat64Value ¶
func NewInt16Value ¶
func NewInt32Value ¶
func NewInt64Value ¶
func NewInt8Value ¶
func NewIntValue ¶
func NewNilValue ¶
func NewNilValue() *Value
func NewStringValue ¶
func NewTimeValue ¶
func NewUint16Value ¶
func NewUint32Value ¶
func NewUint64Value ¶
func NewUint8Value ¶
func NewUintValue ¶
func StructSliceValueToValue ¶
func StructSliceValueToValue(v *StructSliceValue) *Value
func StructValueToValue ¶
func StructValueToValue(v *StructValue) *Value
func ValuesToValue ¶
type ValueDecoder ¶
type ValueDecoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(s *Struct, buf *bytes.Buffer, valueFactory *ValueFactory) *ValueDecoder
func (*ValueDecoder) Decode ¶
func (d *ValueDecoder) Decode() (*StructValue, error)
func (*ValueDecoder) DecodeSlice ¶
func (d *ValueDecoder) DecodeSlice() (*StructSliceValue, error)
func (*ValueDecoder) SetBuffer ¶
func (d *ValueDecoder) SetBuffer(content []byte)
type ValueFactory ¶
type ValueFactory struct {
// contains filtered or unexported fields
}
func NewValueFactory ¶
func NewValueFactory() *ValueFactory
func (*ValueFactory) CreateBoolPtrValue ¶
func (f *ValueFactory) CreateBoolPtrValue(v *bool) *Value
func (*ValueFactory) CreateBoolValue ¶
func (f *ValueFactory) CreateBoolValue(v bool) *Value
func (*ValueFactory) CreateBytesPtrValue ¶
func (f *ValueFactory) CreateBytesPtrValue(v *[]byte) *Value
func (*ValueFactory) CreateBytesValue ¶
func (f *ValueFactory) CreateBytesValue(v []byte) *Value
func (*ValueFactory) CreateDefaultValue ¶
func (f *ValueFactory) CreateDefaultValue(typ TypeID) *Value
func (*ValueFactory) CreateFloat32PtrValue ¶
func (f *ValueFactory) CreateFloat32PtrValue(v *float32) *Value
func (*ValueFactory) CreateFloat32Value ¶
func (f *ValueFactory) CreateFloat32Value(v float32) *Value
func (*ValueFactory) CreateFloat64PtrValue ¶
func (f *ValueFactory) CreateFloat64PtrValue(v *float64) *Value
func (*ValueFactory) CreateFloat64Value ¶
func (f *ValueFactory) CreateFloat64Value(v float64) *Value
func (*ValueFactory) CreateInt16PtrValue ¶
func (f *ValueFactory) CreateInt16PtrValue(v *int16) *Value
func (*ValueFactory) CreateInt16Value ¶
func (f *ValueFactory) CreateInt16Value(v int16) *Value
func (*ValueFactory) CreateInt32PtrValue ¶
func (f *ValueFactory) CreateInt32PtrValue(v *int32) *Value
func (*ValueFactory) CreateInt32Value ¶
func (f *ValueFactory) CreateInt32Value(v int32) *Value
func (*ValueFactory) CreateInt64PtrValue ¶
func (f *ValueFactory) CreateInt64PtrValue(v *int64) *Value
func (*ValueFactory) CreateInt64Value ¶
func (f *ValueFactory) CreateInt64Value(v int64) *Value
func (*ValueFactory) CreateInt8PtrValue ¶
func (f *ValueFactory) CreateInt8PtrValue(v *int8) *Value
func (*ValueFactory) CreateInt8Value ¶
func (f *ValueFactory) CreateInt8Value(v int8) *Value
func (*ValueFactory) CreateIntPtrValue ¶
func (f *ValueFactory) CreateIntPtrValue(v *int) *Value
func (*ValueFactory) CreateIntValue ¶
func (f *ValueFactory) CreateIntValue(v int) *Value
func (*ValueFactory) CreateStringPtrValue ¶
func (f *ValueFactory) CreateStringPtrValue(v *string) *Value
func (*ValueFactory) CreateStringValue ¶
func (f *ValueFactory) CreateStringValue(v string) *Value
func (*ValueFactory) CreateTimePtrValue ¶
func (f *ValueFactory) CreateTimePtrValue(v *time.Time) *Value
func (*ValueFactory) CreateTimeValue ¶
func (f *ValueFactory) CreateTimeValue(v time.Time) *Value
func (*ValueFactory) CreateUint16PtrValue ¶
func (f *ValueFactory) CreateUint16PtrValue(v *uint16) *Value
func (*ValueFactory) CreateUint16Value ¶
func (f *ValueFactory) CreateUint16Value(v uint16) *Value
func (*ValueFactory) CreateUint32PtrValue ¶
func (f *ValueFactory) CreateUint32PtrValue(v *uint32) *Value
func (*ValueFactory) CreateUint32Value ¶
func (f *ValueFactory) CreateUint32Value(v uint32) *Value
func (*ValueFactory) CreateUint64PtrValue ¶
func (f *ValueFactory) CreateUint64PtrValue(v *uint64) *Value
func (*ValueFactory) CreateUint64Value ¶
func (f *ValueFactory) CreateUint64Value(v uint64) *Value
func (*ValueFactory) CreateUint8PtrValue ¶
func (f *ValueFactory) CreateUint8PtrValue(v *uint8) *Value
func (*ValueFactory) CreateUint8Value ¶
func (f *ValueFactory) CreateUint8Value(v uint8) *Value
func (*ValueFactory) CreateUintPtrValue ¶
func (f *ValueFactory) CreateUintPtrValue(v *uint) *Value
func (*ValueFactory) CreateUintValue ¶
func (f *ValueFactory) CreateUintValue(v uint) *Value
func (*ValueFactory) CreateUniqueValues ¶ added in v0.0.6
func (f *ValueFactory) CreateUniqueValues(v interface{}) []*Value
func (*ValueFactory) CreateValue ¶
func (f *ValueFactory) CreateValue(v interface{}) *Value
func (*ValueFactory) CreateValueFromString ¶
func (f *ValueFactory) CreateValueFromString(v string, typeID TypeID) (*Value, error)
type ValueIterator ¶
type ValueIterator struct {
// contains filtered or unexported fields
}
func NewValueIterator ¶
func NewValueIterator(keys []server.CacheKey) *ValueIterator
func (*ValueIterator) Error ¶
func (i *ValueIterator) Error() error
func (*ValueIterator) Next ¶
func (i *ValueIterator) Next() bool
func (*ValueIterator) PrimaryKey ¶
func (i *ValueIterator) PrimaryKey() server.CacheKey
func (*ValueIterator) QueryByPrimaryKey ¶
func (i *ValueIterator) QueryByPrimaryKey(factory *ValueFactory, primaryIndex *Index) (*Query, error)
func (*ValueIterator) Reset ¶
func (i *ValueIterator) Reset()
func (*ValueIterator) SetError ¶
func (i *ValueIterator) SetError(err error)
func (*ValueIterator) SetErrorWithKey ¶
func (i *ValueIterator) SetErrorWithKey(key server.CacheKey, err error)
func (*ValueIterator) SetValue ¶
func (i *ValueIterator) SetValue(value *StructValue)
func (*ValueIterator) SetValueWithKey ¶
func (i *ValueIterator) SetValueWithKey(key server.CacheKey, value *StructValue)
func (*ValueIterator) Value ¶
func (i *ValueIterator) Value() *StructValue
type Values ¶
type Values []*Value
func (Values) Float32Ptr ¶
func (Values) Float64Ptr ¶
func (Values) Slice ¶
func (Values) Slice(string, Unmarshaler)
func (Values) Struct ¶
func (Values) Struct(string, Unmarshaler)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.