Documentation
¶
Index ¶
- Constants
- func DefaultLocalExpiration() time.Duration
- func KS(es ...*Entry) map[string]interface{}
- type Entry
- func (e *Entry) Data() []byte
- func (e *Entry) Decode(data []byte) error
- func (e *Entry) EnableLocalCache() bool
- func (e *Entry) Encode() error
- func (e *Entry) Exp() time.Duration
- func (e *Entry) Key() string
- func (e *Entry) LocalExp() time.Duration
- func (e *Entry) Reset()
- func (e *Entry) SetSource(s int)
- func (e *Entry) SetTTL(ttl float64)
- func (e *Entry) SourceCenter() bool
- func (e *Entry) SourceLocal() bool
- func (e *Entry) TTL() float64
- func (e *Entry) Value() interface{}
- type Setting
Constants ¶
View Source
const ( // SourceLocal local cache SourceLocal int // SourceCenter center cache SourceCenter )
Variables ¶
This section is empty.
Functions ¶
func DefaultLocalExpiration ¶ added in v0.4.0
DefaultLocalExpiration returns the default of local expiration.
Types ¶
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry a cache entry.
func (*Entry) EnableLocalCache ¶
EnableLocalCache enables the local expiration.
func (*Entry) SourceCenter ¶ added in v0.2.0
SourceCenter reports cache from center.
func (*Entry) SourceLocal ¶ added in v0.2.0
SourceLocal reports cache from local.
type Setting ¶ added in v0.2.0
Setting configures an entry.
func EnableLocalCache ¶ added in v0.2.0
func EnableLocalCache() Setting
EnableLocalCache enables local cache.
func WithExpiration ¶ added in v0.2.0
WithExpiration sets the expiration for the key.
Click to show internal directories.
Click to hide internal directories.