store

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.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 Store

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

Store enables interaction with a database.

func New

func New(db *pebble.DB) *Store

New creates a new Store backed by the database at the given path.

func (*Store) Delete

func (s *Store) Delete(key string) error

Delete removes the key from the database.

func (*Store) Get

func (s *Store) Get(key string) (string, error)

Get retrieves the value for a key.

func (*Store) GetRecord

func (s *Store) GetRecord(key string, out interface{}) error

GetRecord will read and JSON-decode the record associated with the provided key.

func (*Store) Keys

func (s *Store) Keys() []string

Keys returns the list of all keys in the database.

func (*Store) Set

func (s *Store) Set(key string, value string) error

Set sets the value for a key.

func (*Store) SetRecord

func (s *Store) SetRecord(key string, value interface{}) error

SetRecord will JSON-encode the provided record and store it in the DB.

Jump to

Keyboard shortcuts

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