cache

package
v0.0.0-...-52b9b3c Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareTimeStamp

func CompareTimeStamp(a []byte, b []byte) bool

Types

type BoltDBCache

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

func NewCache

func NewCache(path string) (*BoltDBCache, error)

func (*BoltDBCache) Add

func (c *BoltDBCache) Add(key string, value interface{}) error

func (*BoltDBCache) ClearBefore

func (c *BoltDBCache) ClearBefore(t time.Time) error

func (*BoltDBCache) GetAfter

func (c *BoltDBCache) GetAfter(t time.Time) (result []interface{}, err error)

type Cache

type Cache interface {
	Add(key string, value interface{}) error
	ClearBefore(time.Time) error
	GetAfter(time.Time) ([]interface{}, error)
}

type TimeValue

type TimeValue struct {
	Time  time.Time   `json:"time,omitempty"`
	Value interface{} `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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