Documentation ¶
Index ¶
- Variables
- func BatchReadThrough(c BatchCache, miss BatchRead, keys interface{}) (interface{}, error)
- func MarshalJSON(v interface{}) ([]byte, error)
- func UnmarshalJSON(b []byte, typ reflect.Type) (interface{}, error)
- type BatchCache
- type BatchRead
- type BatchWrite
- type ChainedBatchCache
- type MapCache
- type RedisCache
- func (r *RedisCache) BatchRead(keys *Slice) (*Slice, error)
- func (r *RedisCache) BatchWrite(keys *Slice, values *Slice) error
- func (r *RedisCache) CanDelete() bool
- func (r *RedisCache) Delete(keys *Slice) error
- func (r *RedisCache) ValueType() reflect.Type
- func (r *RedisCache) WithEX(d time.Duration) *RedisCache
- func (r *RedisCache) WithNX() *RedisCache
- func (r *RedisCache) WithValueType(valueType reflect.Type) *RedisCache
- type Slice
- func (s *Slice) Copy() *Slice
- func (s *Slice) FillMissed(data *Slice)
- func (s *Slice) Filter(indexs []int) *Slice
- func (s *Slice) Initialized() bool
- func (s *Slice) Interfaces() []interface{}
- func (s *Slice) Len() int
- func (s *Slice) Missed() []int
- func (s *Slice) Specific() interface{}
- func (s *Slice) SpecificValue() reflect.Value
- func (s *Slice) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheMissed cacheMissed
Functions ¶
func BatchReadThrough ¶
func BatchReadThrough(c BatchCache, miss BatchRead, keys interface{}) (interface{}, error)
func MarshalJSON ¶
Types ¶
type BatchCache ¶
type BatchRead ¶
type BatchRead func(keys interface{}) (interface{}, error)
func VariantBatchRead ¶
func VariantBatchRead(fn interface{}) BatchRead
type BatchWrite ¶
type BatchWrite func(keys interface{}, values interface{}) error
func VariantBatchWrite ¶
func VariantBatchWrite(fn interface{}) BatchWrite
type ChainedBatchCache ¶
type ChainedBatchCache struct {
// contains filtered or unexported fields
}
func ChainBatchCache ¶
func ChainBatchCache(upper BatchCache, lowers ...BatchCache) (*ChainedBatchCache, error)
func (*ChainedBatchCache) BatchRead ¶
func (cc *ChainedBatchCache) BatchRead(keys *Slice) (*Slice, error)
func (*ChainedBatchCache) BatchWrite ¶
func (cc *ChainedBatchCache) BatchWrite(keys *Slice, values *Slice) error
func (*ChainedBatchCache) CanDelete ¶
func (cc *ChainedBatchCache) CanDelete() bool
func (*ChainedBatchCache) Delete ¶
func (cc *ChainedBatchCache) Delete(keys *Slice) error
func (*ChainedBatchCache) ValueType ¶
func (cc *ChainedBatchCache) ValueType() reflect.Type
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(pool *redis.Pool, valueType reflect.Type) *RedisCache
func (*RedisCache) BatchWrite ¶
func (r *RedisCache) BatchWrite(keys *Slice, values *Slice) error
func (*RedisCache) CanDelete ¶
func (r *RedisCache) CanDelete() bool
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(keys *Slice) error
func (*RedisCache) ValueType ¶
func (r *RedisCache) ValueType() reflect.Type
func (*RedisCache) WithEX ¶
func (r *RedisCache) WithEX(d time.Duration) *RedisCache
func (*RedisCache) WithNX ¶
func (r *RedisCache) WithNX() *RedisCache
func (*RedisCache) WithValueType ¶
func (r *RedisCache) WithValueType(valueType reflect.Type) *RedisCache
type Slice ¶
type Slice struct {
// contains filtered or unexported fields
}
func SliceFromInterfaces ¶
func SliceFromReflectValue ¶
func SliceFromSpecific ¶
func SliceFromSpecific(spec interface{}) *Slice
func (*Slice) FillMissed ¶
func (*Slice) Initialized ¶
func (*Slice) Interfaces ¶
func (s *Slice) Interfaces() []interface{}
func (*Slice) SpecificValue ¶
Click to show internal directories.
Click to hide internal directories.