cache

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func NewCache

func NewCache(cache *badger.DB) *Cache

func (*Cache) GetPosition

func (c *Cache) GetPosition(ticker string) (position.Position, error)

func (*Cache) InitializePosition

func (c *Cache) InitializePosition(p []position.Position) error

func (*Cache) Positions

func (c *Cache) Positions() []position.Position

func (*Cache) UpdatePosition

func (c *Cache) UpdatePosition(p position.Position) error

type Key

type Key func(ticker string) []byte
var (
	Position Key = func(ticker string) []byte { return pkg.StringToBytes(fmt.Sprintf("%s:%s", PositionPrefix, ticker)) }
)

type Prefix

type Prefix string
const (
	PositionPrefix Prefix = "position"
)

Jump to

Keyboard shortcuts

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