store

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2023 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Store *cache.Cache
}

func Init

func Init() *Handler

Init init store

func (*Handler) Get

func (l *Handler) Get(key string) (interface{}, bool)

Get an item from the store. Returns the item or nil, and a bool indicating whether the key was found.

func (*Handler) Set

func (l *Handler) Set(key string, value interface{}, d time.Duration)

Set an item to the store, replacing any existing item. If the duration is 0 (DefaultExpiration), the store's default expiration time is used. If it is -1 (NoExpiration), the item never expires.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL