README ¶ cof Key-value cache Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Constants func CleanInterval(ci time.Duration) option func TTL(ttl time.Duration) option type C func Init[T any](opts ...option) (*C[T], error) func (c *C[T]) Get(k string) (T, bool) func (c *C[T]) Pop(k string) (T, bool) func (c *C[T]) Put(k string, v T) func (c *C[T]) Stop() Constants ¶ View Source const ( OFF = 0 ) Variables ¶ This section is empty. Functions ¶ func CleanInterval ¶ func CleanInterval(ci time.Duration) option func TTL ¶ func TTL(ttl time.Duration) option Types ¶ type C ¶ type C[T any] struct { sync.RWMutex // contains filtered or unexported fields } func Init ¶ func Init[T any](opts ...option) (*C[T], error) func (*C[T]) Get ¶ func (c *C[T]) Get(k string) (T, bool) func (*C[T]) Pop ¶ func (c *C[T]) Pop(k string) (T, bool) func (*C[T]) Put ¶ func (c *C[T]) Put(k string, v T) func (*C[T]) Stop ¶ func (c *C[T]) Stop() Source Files ¶ View all Source files cof.go Click to show internal directories. Click to hide internal directories.