Documentation ¶
Index ¶
- Constants
- func ValueToInt32(v Value) int32
- func ValueToString(v Value) string
- type Cache
- func (c *Cache) Close()
- func (c *Cache) DiskCacheSize() int
- func (c *Cache) GetCached(now time.Time, key []byte) Result
- func (c *Cache) GetCachedString(now time.Time, key string) Result
- func (c *Cache) GetOrLoad(now time.Time, key string, extra interface{}) Result
- func (c *Cache) GetOrLoadCallback(now time.Time, key string, extra interface{}, cb Callback) Result
- func (c *Cache) SetBootstrapValue(now time.Time, key string, v Value, ttl time.Duration) error
- type Callback
- type DiskCache
- func (dc *DiskCache) Close() error
- func (dc *DiskCache) Count(ns string) (int, error)
- func (dc *DiskCache) Erase(ns string, key string) error
- func (dc *DiskCache) EraseNamespace(ns string) error
- func (dc *DiskCache) Get(ns string, key string) ([]byte, time.Time, time.Duration, error, bool)
- func (dc *DiskCache) List(ns string) ([]ListResult, error)
- func (dc *DiskCache) Set(ns string, key string, val []byte, update time.Time, ttl time.Duration) error
- type Int32Value
- type ListResult
- type LoaderFunc
- type Result
- type StringValue
- type Value
Constants ¶
View Source
const (
DefaultTxDuration = 60 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
func ValueToInt32 ¶
func ValueToString ¶
Types ¶
type Cache ¶
type Cache struct { Loader LoaderFunc DiskCache *DiskCache // we do not cache errors on disk DiskCacheNamespace string MaxMemCacheSize int SpreadCacheTTL bool DefaultCacheTTL time.Duration DefaultNegativeCacheTTL time.Duration LoadMinInterval time.Duration LoadBurst int Empty func() Value // contains filtered or unexported fields }
func (*Cache) DiskCacheSize ¶
func (*Cache) GetOrLoadCallback ¶
If empty result is returned, cb will be called in future
type DiskCache ¶
type DiskCache struct {
// contains filtered or unexported fields
}
func OpenDiskCache ¶
func (*DiskCache) EraseNamespace ¶
erasing not existing is nop
type Int32Value ¶
type Int32Value int32
func (Int32Value) MarshalBinary ¶
func (i Int32Value) MarshalBinary() ([]byte, error)
func (*Int32Value) UnmarshalBinary ¶
func (i *Int32Value) UnmarshalBinary(data []byte) error
type ListResult ¶
type LoaderFunc ¶
type StringValue ¶
type StringValue string
func (StringValue) MarshalBinary ¶
func (s StringValue) MarshalBinary() ([]byte, error)
func (*StringValue) UnmarshalBinary ¶
func (s *StringValue) UnmarshalBinary(data []byte) error
type Value ¶
type Value interface { encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
func Int32ToValue ¶
func StringToValue ¶
Click to show internal directories.
Click to hide internal directories.