Documentation ¶
Index ¶
- Variables
- func GenerateKey(keys ...string) string
- type BoolValue
- type ByteSliceValue
- type ByteValue
- type Cache
- type CmpCache
- type EntryType
- type FloatValue
- type IntValue
- type InterfaceValue
- type StringValue
- type UnsignedValue
- type Value
- type Values
- func GetBoolValue(d bool) (Values, error)
- func GetByteSliceValue(d []byte) (Values, error)
- func GetByteValue(d byte) (Values, error)
- func GetIntValue(d int64) (Values, error)
- func GetInterfaceValue(o interface{}) (Values, error)
- func GetStringValue(d string) (Values, error)
- func GetUnsignedValue(d uint64) (Values, error)
- func MarshalValue(o interface{}) (Values, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EvictError = errors.New("cache memory evicted") NilPtrError = errors.New("nil ptr error") ParamIllegalError = errors.New("size of segments illegal") EntryTypeDifferentError = errors.New("entry and cacheValues type different") WrongEntryKeyError = errors.New("entry key is wrong") InitEntryFailedError = errors.New("entry initialized failed") ValueNotFoundError = errors.New("cacheValues not found") KeyNotFoundError = errors.New("key not found") KeyTooLongError = errors.New("key too long") SizeTooSmallError = errors.New("total size too small") ValueTypeNotFoundError = errors.New("cacheValues type not found") ValueNotSupportError = errors.New("value type not support") IllegalCacheSize = errors.New("illegal cache size") )
View Source
var (
ExpireFreshQueue *queue.TaskQueue
)
Functions ¶
func GenerateKey ¶
Types ¶
type ByteSliceValue ¶
type ByteSliceValue struct {
// contains filtered or unexported fields
}
func (ByteSliceValue) Size ¶
func (b ByteSliceValue) Size() int64
func (ByteSliceValue) String ¶
func (b ByteSliceValue) String() string
func (ByteSliceValue) Type ¶
func (b ByteSliceValue) Type() EntryType
func (ByteSliceValue) Value ¶
func (b ByteSliceValue) Value() interface{}
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implement concurrent safe cache with LRU and ttl strategy.
func GetFreeCache ¶
func GetFreeCache() *Cache
func (*Cache) DecrementSize ¶
DecrementSize reduce specific size of max size
func (*Cache) Get ¶
Get returns cache from key whether key is expired. nil will return if key dose not hit.
func (*Cache) IncreaseSize ¶
IncreaseSize add specific size of max size
type FloatValue ¶
type FloatValue struct {
// contains filtered or unexported fields
}
func (FloatValue) Size ¶
func (f FloatValue) Size() int64
func (FloatValue) String ¶
func (f FloatValue) String() string
func (FloatValue) Type ¶
func (f FloatValue) Type() EntryType
func (FloatValue) Value ¶
func (f FloatValue) Value() interface{}
type InterfaceValue ¶
type InterfaceValue struct {
// contains filtered or unexported fields
}
func (InterfaceValue) Size ¶
func (i InterfaceValue) Size() int64
func (InterfaceValue) String ¶
func (i InterfaceValue) String() string
func (InterfaceValue) Type ¶
func (i InterfaceValue) Type() EntryType
func (InterfaceValue) Value ¶
func (i InterfaceValue) Value() interface{}
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
func (StringValue) Size ¶
func (s StringValue) Size() int64
func (StringValue) String ¶
func (s StringValue) String() string
func (StringValue) Type ¶
func (s StringValue) Type() EntryType
func (StringValue) Value ¶
func (s StringValue) Value() interface{}
type UnsignedValue ¶
type UnsignedValue struct {
// contains filtered or unexported fields
}
func (UnsignedValue) Size ¶
func (u UnsignedValue) Size() int64
func (UnsignedValue) String ¶
func (u UnsignedValue) String() string
func (UnsignedValue) Type ¶
func (u UnsignedValue) Type() EntryType
func (UnsignedValue) Value ¶
func (u UnsignedValue) Value() interface{}
type Values ¶
type Values []Value
func GetBoolValue ¶
func GetByteSliceValue ¶
func GetByteValue ¶
func GetIntValue ¶
func GetInterfaceValue ¶
func GetStringValue ¶
func GetUnsignedValue ¶
func MarshalValue ¶
Click to show internal directories.
Click to hide internal directories.