Pkg
Cache

Cache

Explore the following sections to learn more:

cache

import "github.com/gemini-oss/rego/pkg/common/cache"

pkg/common/cache/cache.go

Index

Variables

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

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

CacheOptions defines options for creating a new cache

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

Generated by gomarkdoc