data

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotSetValue = int64(0)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the data store.

func New

func New(path string) (*Store, error)

New initializes the database for a given name.

func (*Store) Close

func (s *Store) Close() error

Close closes the database if one of previously created.

func (*Store) Delete

func (s *Store) Delete(id string) (deleted bool, err error)

Delete deletes the value of the given id.

func (*Store) Get

func (s *Store) Get(id string) (val int64, err error)

Get gets the value of the given id.

func (*Store) Query

func (s *Store) Query(v string) ([]int64, error)

func (*Store) Save

func (s *Store) Save(id string, val int64) error

Save saves the value of the given id.

func (*Store) SaveAll

func (s *Store) SaveAll(ids map[string]int64) error

SaveAll saves all the ids in the database.

func (*Store) Update

func (s *Store) Update(id string, val int64) (updated bool, err error)

Update updates the value of the given id.

func (*Store) Upsert

func (s *Store) Upsert(id string, val int64) error

Upsert updates the value of the given id.

Jump to

Keyboard shortcuts

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