rsstore

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_Session_ID   = "rs-session"
	C_Session_User = "rs-user"
)

Variables

This section is empty.

Functions

func Cache

func Cache() *sync.Map

func Config

func Config() *sync.Map

func CreateDB

func CreateDB(dbName string) error

func GetCache

func GetCache(key string, bDelete bool, beforeDelleteFunc func(v interface{}) bool) interface{}

delete: beforeDelleteFunc return true

func GetConf

func GetConf(key string) string

func InitSession

func InitSession() error

func InitStore

func InitStore(path string) error

func LoadFromDB

func LoadFromDB(dbName, key string, ptrObject any) error

func PopFromSession

func PopFromSession(r *http.Request, key string) interface{}

func PushToSession

func PushToSession(w http.ResponseWriter, r *http.Request, key string, cacheData interface{}) error

func RemoveSession

func RemoveSession(w http.ResponseWriter, r *http.Request, key string) error

func SaveToDB

func SaveToDB(cache *sync.Map, dbName string, cacheKey, cacheValue any) (retErr error)

func SetCache

func SetCache(key string, val interface{}, bForce bool) error

func SetCacheByTime

func SetCacheByTime(key string, val interface{}, bForce bool, timeout time.Duration, callback func(key, val any) bool) error

func SetConf

func SetConf(key, val string)

func Store

func Store() *db_bolt

Types

This section is empty.

Jump to

Keyboard shortcuts

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