badger

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package badger is the BadgerDB implementation of the Trickster Cache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Name   string
	Config *options.Options
	Logger *log.Logger
	// contains filtered or unexported fields
}

Cache describes a Badger Cache

func (*Cache) BulkRemove

func (c *Cache) BulkRemove(cacheKeys []string)

BulkRemove removes a list of objects from the cache. noLock is not used for Badger

func (*Cache) Close

func (c *Cache) Close() error

Close closes the Badger Cache

func (*Cache) Configuration

func (c *Cache) Configuration() *options.Options

Configuration returns the Configuration for the Cache object

func (*Cache) Connect

func (c *Cache) Connect() error

Connect opens the configured Badger key-value store

func (*Cache) Locker

func (c *Cache) Locker() locks.NamedLocker

Locker returns the cache's locker

func (*Cache) Remove

func (c *Cache) Remove(cacheKey string)

Remove removes an object in cache, if present

func (*Cache) Retrieve

func (c *Cache) Retrieve(cacheKey string, allowExpired bool) ([]byte, status.LookupStatus, error)

Retrieve gets data from the Badger Cache using the provided Key because Badger manages Object Expiration internally, allowExpired is not used.

func (*Cache) SetLocker

func (c *Cache) SetLocker(l locks.NamedLocker)

SetLocker sets the cache's locker

func (*Cache) SetTTL

func (c *Cache) SetTTL(cacheKey string, ttl time.Duration)

SetTTL updates the TTL for the provided cache object

func (*Cache) Store

func (c *Cache) Store(cacheKey string, data []byte, ttl time.Duration) error

Store places the the data into the Badger Cache using the provided Key and TTL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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