datastore

package
v0.0.0-...-bda66fc Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializable

type Serializable interface {
	Hash() (hash.Hash, error)
	Serialize() ([]byte, error)
	Deserialize([]byte) error
	Type() string
	JSON() error
	ReInit() error
}

Serializable allows for the storage of any kind of data

type Store

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

Store is responsible for storing the actual data on the tangle

func New

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

New returns an initialized Store

func (*Store) Close

func (s *Store) Close()

Close closes the db connection

func (*Store) Get

func (s *Store) Get(dest Serializable, h hash.Hash) error

Get retrieves the serialized object

func (*Store) Put

func (s *Store) Put(e Serializable) error

Put stores the serialized element in the database

Jump to

Keyboard shortcuts

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