Documentation ¶
Index ¶
- Variables
- type CacheIf
- type FlightGroupIf
- type GetterIf
- type GetterIfFunc
- type ICache
- type LRUByteCache
- func (c *LRUByteCache) Del(ctx context.Context, strKey string) error
- func (c *LRUByteCache) Get(ctx context.Context, strKey string) (interface{}, error)
- func (c *LRUByteCache) IsErrNotFound(err error) bool
- func (c *LRUByteCache) Set(ctx context.Context, strKey string, valIf interface{}, iTTL int32) error
- type LRUObjCache
- func (c *LRUObjCache) Del(ctx context.Context, strKey string) error
- func (c *LRUObjCache) Get(ctx context.Context, strKey string) (interface{}, error)
- func (c *LRUObjCache) IsErrNotFound(err error) bool
- func (c *LRUObjCache) Set(ctx context.Context, strKey string, valIf interface{}, iTTL int32) error
- type Option
- type SinkIf
- type Stats
- type View
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CacheIf ¶
type CacheIf interface { Get(context.Context, string) (interface{}, error) Set(context.Context, string, interface{}, int32) error Del(context.Context, string) error IsErrNotFound(err error) bool }
CacheIf cache interface
func NewLRUByteCacheWithEvict ¶
func NewLRUByteCacheWithEvict(iSize int, onEvicted func(key interface{}, value interface{})) CacheIf
NewLRUByteCacheWithEvict new lru cache
func NewLRUObjCacheWithEvict ¶
NewLRUObjCacheWithEvict new lru cache
type FlightGroupIf ¶
FlightGroupIf flight group
type GetterIfFunc ¶
GetterIfFunc func
type ICache ¶
type ICache struct {
// contains filtered or unexported fields
}
ICache ICache struct
type LRUByteCache ¶
type LRUByteCache struct {
// contains filtered or unexported fields
}
LRUByteCache
func (*LRUByteCache) Del ¶
func (c *LRUByteCache) Del(ctx context.Context, strKey string) error
Del del
func (*LRUByteCache) Get ¶
func (c *LRUByteCache) Get(ctx context.Context, strKey string) (interface{}, error)
Get get
func (*LRUByteCache) IsErrNotFound ¶
func (c *LRUByteCache) IsErrNotFound(err error) bool
IsErrNotFound is not found err
type LRUObjCache ¶
type LRUObjCache struct {
// contains filtered or unexported fields
}
LRUObjCache lru obj cache
func (*LRUObjCache) Del ¶
func (c *LRUObjCache) Del(ctx context.Context, strKey string) error
Del del
func (*LRUObjCache) Get ¶
func (c *LRUObjCache) Get(ctx context.Context, strKey string) (interface{}, error)
Get get
func (*LRUObjCache) IsErrNotFound ¶
func (c *LRUObjCache) IsErrNotFound(err error) bool
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option option
func SetFlightGroup ¶
func SetFlightGroup(flightGroup FlightGroupIf) Option
SetFlightGroup set flight group
type SinkIf ¶
type SinkIf interface { SetView(v View) error GetView() (View, error) SetBytes([]byte) error SetString(string) error SetObj(interface{}) error SetTTL(int32) error }
SinkIf sink interface
type Stats ¶
type Stats struct { GetCnt int64 // cache get op cnt DelCnt int64 // cache del op cnt HitCnt int64 // cache hit cnt ErrCnt int64 // cache errors cnt MissCnt int64 // cache miss cnt SourceCnt int64 // get from source cnt SourceHitCnt int64 // get from source hit cnt SourceErrCnt int64 // get from source err cnt }
Stats stat
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package singleflight provides a duplicate function call suppression mechanism.
|
Package singleflight provides a duplicate function call suppression mechanism. |
Click to show internal directories.
Click to hide internal directories.