cache

package
v0.0.0-...-7a4e58b Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

pkg/common/cache/cache.go

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeySize = errors.New("invalid encryption key size")
)

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Enabled bool // Defines if the cache is enabled
	// contains filtered or unexported fields
}

func NewCache

func NewCache(args ...interface{}) (*Cache, error)

func (*Cache) Get

func (c *Cache) Get(key string) ([]byte, bool)

func (*Cache) Set

func (c *Cache) Set(key string, value interface{}, duration time.Duration) error

type CacheItem

type CacheItem struct {
	Data    string
	Expires time.Time
}

type CacheOptions

type CacheOptions struct {
	EncryptionKey   []byte
	PersistencePath string
	InMemory        bool
	MaxItems        int
}

CacheOptions defines options for creating a new cache

Jump to

Keyboard shortcuts

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