simplecache

package
v0.0.0-...-642df0c Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION string = "r.20240114.2007"

	LOG_INTERVAL_SEC uint16 = 60 // log every 60 seconds
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Id   string      `json:"id"`
	Data string      `json:"data"`
	Obj  interface{} `json:"-"` // any ; this field should not be exported to JSON, it is intended to store internal specific Go Objects
}

type InMemCache

type InMemCache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(name string, cleanupInterval time.Duration, debug bool) *InMemCache

func (*InMemCache) Get

func (lc *InMemCache) Get(id string) (found bool, o CacheEntry, expTimeStamp int64)

func (*InMemCache) GetName

func (lc *InMemCache) GetName() string

func (*InMemCache) GetSize

func (lc *InMemCache) GetSize() int

func (*InMemCache) Set

func (lc *InMemCache) Set(o CacheEntry, expirationInSecondsFromNow int64) bool

func (*InMemCache) SetExpiration

func (lc *InMemCache) SetExpiration(id string, expirationInSecondsFromNow int64) bool

func (*InMemCache) Unset

func (lc *InMemCache) Unset(id string) bool

Jump to

Keyboard shortcuts

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