db

package
v0.0.0-...-c37bf4f Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	Path string
	DB   *bolt.DB
}

func NewDB

func NewDB(path string) (*T, error)

func (*T) DeleteScrap

func (db *T) DeleteScrap(key []byte) (e error)

func (*T) DeleteTransaction

func (db *T) DeleteTransaction(hash types.Hash) (e error)

func (*T) GetBlock

func (db *T) GetBlock(hash []byte) (blk *block.Block, e error)

func (*T) GetKey

func (db *T) GetKey(alias string) (k *ecdsa.PrivateKey, e error)

func (*T) GetLastBlock

func (db *T) GetLastBlock() (blk *block.Block, e error)

func (*T) GetMainKey

func (db *T) GetMainKey() (k *ecdsa.PrivateKey, e error)

func (*T) GetNextBlock

func (db *T) GetNextBlock(hash types.Hash) (blk *block.Block, e error)

func (*T) GetNextTransactionHash

func (db *T) GetNextTransactionHash(hash []byte) (h types.Hash, e error)

func (*T) GetPreviousEnvelopeHashForPublicKey

func (db *T) GetPreviousEnvelopeHashForPublicKey(publicKey *ecdsa.PublicKey) (h types.Hash, e error)

func (*T) GetRef

func (db *T) GetRef(name, ref string) (h repository.Ref, e error)

func (*T) GetRepository

func (db *T) GetRepository(name string) (r *repository.T, e error)

func (*T) GetScrap

func (db *T) GetScrap(key []byte) (b []byte, e error)

func (*T) GetTransaction

func (db *T) GetTransaction(hash types.Hash) (envelope *transaction.Envelope, e error)

func (*T) GetTransactionBlock

func (db *T) GetTransactionBlock(hash types.Hash) (b *block.Block, e error)

func (*T) GetTransactionConfirmations

func (db *T) GetTransactionConfirmations(hash []byte) (int, error)

func (*T) ListKeys

func (db *T) ListKeys() (keys []string)

func (*T) ListPendingRepositories

func (db *T) ListPendingRepositories() (keys []string)

func (*T) ListRefs

func (db *T) ListRefs(name string) (refs []string, e error)

func (*T) ListRepositories

func (db *T) ListRepositories() (keys []string)

func (*T) PutBlock

func (db *T) PutBlock(b *block.Block, last bool) (e error)

func (*T) PutKey

func (db *T) PutKey(alias string, key *ecdsa.PrivateKey, main bool) (e error)

func (*T) PutRef

func (db *T) PutRef(name, ref string, new repository.Ref) (e error)

func (*T) PutRepository

func (db *T) PutRepository(repo *repository.T) (e error)

func (*T) PutScrap

func (db *T) PutScrap(key, val []byte) (e error)

func (*T) PutTransaction

func (db *T) PutTransaction(tx *transaction.Envelope) (e error)

Jump to

Keyboard shortcuts

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