boltkv_cache

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheElement

type CacheElement struct {
	Data   []byte
	Key    string
	Option option `json:"option"`
}

type CacheStore

type CacheStore struct {
	boltkv.BoltStore
	Default option
}

func NewCacheStore

func NewCacheStore(store boltkv.BoltStore, defaults ...Option) *CacheStore

func (CacheStore) GetCache

func (s CacheStore) GetCache(k string) ([]byte, error)

func (CacheStore) SetCache

func (s CacheStore) SetCache(k string, v []byte, opts ...Option) error

type Option

type Option func(o *option)

func WithDuration

func WithDuration(d time.Duration) Option

func WithExpireAt

func WithExpireAt(t time.Time) Option

Jump to

Keyboard shortcuts

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