sqlite

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvCacheRotateTable env value for override default value
	EnvCacheRotateTable = `CACHE_ROTATE_TABLE`
	// DefaultCacheRotateTable default value for rotate tables
	DefaultCacheRotateTable = int64(60 * 60 * 2)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache sqlite cache

func New

func New(path, prefix string) (*Cache, error)

New init new cache

func (*Cache) Delete added in v0.0.5

func (c *Cache) Delete(key string) error

Delete value by key

func (*Cache) Get

func (c *Cache) Get(key string) (value float64, updatedAt int64, found bool, err error)

Get return value, updatedAt, error we get data from prev table, if not found key in current

func (*Cache) Set

func (c *Cache) Set(key string, value float64) error

Set new value in cache

Jump to

Keyboard shortcuts

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