Documentation ¶
Index ¶
- func Now() int64
- func Zero[T any]() T
- type MemDriver
- type MemDriverMemory
- func (md *MemDriverMemory[T]) Exists(key string) bool
- func (md *MemDriverMemory[T]) Expire(key string)
- func (md *MemDriverMemory[T]) Inc(key string, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverMemory[T]) IncBy(key string, value int, expire time.Duration, overwriteTTLIfExists bool) int
- func (md *MemDriverMemory[T]) Init(kargs ...string)
- func (md *MemDriverMemory[T]) List(key string) []string
- func (md *MemDriverMemory[T]) Read(key string) (T, bool)
- func (md *MemDriverMemory[T]) SetExpire(key string, duration time.Duration) time.Duration
- func (md *MemDriverMemory[T]) Wipe(prefix string)
- func (md *MemDriverMemory[T]) WipePrefix(prefix string)
- func (md *MemDriverMemory[T]) Write(key string, value T, expire time.Duration, overwriteTTLIfExists bool) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemDriver ¶
type MemDriver[T any] interface { Init(kargs ...string) Read(key string) (T, bool) Write(key string, value T, expire time.Duration, overwriteTTLIfExists bool) T IncBy(key string, value int, expire time.Duration, overwriteTTLIfExists bool) int Inc(key string, expire time.Duration, overwriteTTLIfExists bool) int List(prefix string) []string Expire(key string) SetExpire(key string, duration time.Duration) time.Duration Exists(key string) bool Wipe(prefix string) WipePrefix(prefix string) }
type MemDriverMemory ¶
type MemDriverMemory[T comparable] struct { MemDriver[T] // contains filtered or unexported fields }
func (*MemDriverMemory[T]) Exists ¶
func (md *MemDriverMemory[T]) Exists(key string) bool
func (*MemDriverMemory[T]) Expire ¶
func (md *MemDriverMemory[T]) Expire(key string)
func (*MemDriverMemory[T]) Init ¶
func (md *MemDriverMemory[T]) Init(kargs ...string)
func (*MemDriverMemory[T]) List ¶
func (md *MemDriverMemory[T]) List(key string) []string
func (*MemDriverMemory[T]) Read ¶
func (md *MemDriverMemory[T]) Read(key string) (T, bool)
func (*MemDriverMemory[T]) Wipe ¶
func (md *MemDriverMemory[T]) Wipe(prefix string)
func (*MemDriverMemory[T]) WipePrefix ¶
func (md *MemDriverMemory[T]) WipePrefix(prefix string)
Click to show internal directories.
Click to hide internal directories.