Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteExpired ¶
DeleteExpired deletes expired value from Gache it can be cancel using context
func Set ¶
func Set(key string, val interface{})
Set sets key-value to Gache using default expiration
func SetWithExpire ¶
SetWithExpire sets key-value & expiration to Gache
Types ¶
type Gache ¶
type Gache interface { Clear() Delete(string) DeleteExpired(ctx context.Context) <-chan uint64 Foreach(context.Context, func(string, interface{}, int64) bool) Gache Get(string) (interface{}, bool) Set(string, interface{}) SetDefaultExpire(time.Duration) Gache SetExpiredHook(f func(context.Context, string)) Gache EnableExpiredHook() Gache DisableExpiredHook() Gache SetWithExpire(string, interface{}, time.Duration) StartExpired(context.Context, time.Duration) Gache ToMap(context.Context) *sync.Map }
Gache is base interface type
func DisableExpiredHook ¶
func DisableExpiredHook() Gache
DisableExpiredHook disables expired hook function
func EnableExpiredHook ¶
func EnableExpiredHook() Gache
EnableExpiredHook enables expired hook function
func SetDefaultExpire ¶
SetDefaultExpire set expire duration
Click to show internal directories.
Click to hide internal directories.