Documentation ¶
Index ¶
- Variables
- func CommonGet[V msg.Value](c *Cache, key string, timeoutSecond int64, handler msg.Handler[V]) any
- func Delete(c *Cache, keys ...string)
- func Get(c *Cache, key string, timeoutSecond int64) (value interface{}, effective, exists bool)
- func Length(c *Cache) int64
- func Set[V msg.Value](c *Cache, key string, value V) (err error)
- type Bucket
- func (z *Bucket) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Bucket) EncodeMsg(en *msgp.Writer) (err error)
- func (b *Bucket) Marshal() (data []byte, err error)
- func (z *Bucket) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Bucket) Msgsize() (s int)
- func (z *Bucket) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Cache
- type Entry
- type Info
- type Item
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidDataType = errors.New("invalid data type")
View Source
var (
FlushWithoutChangeIntervalSeconds int64 = 60
)
Functions ¶
Types ¶
type Bucket ¶
type Bucket struct { Data map[string]*Entry `msg:"data"` // contains filtered or unexported fields }
func (*Bucket) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
type Entry ¶
type Entry struct { UpdatedAt int64 `msg:"u"` CreatedAt int64 `msg:"c"` Value interface{} `msg:"v"` // contains filtered or unexported fields }
func (Entry) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Entry) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Entry) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
Click to show internal directories.
Click to hide internal directories.