db

package
v0.0.0-...-4ca9d74 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 12 Imported by: 0

README

SQLite db implementation

The Datastore interface allows for a pluggable wallet database. OpenBazaar, for example, uses its own Datastore implementation so that wallet data can be stored in the same database alongside the rest of OpenBazaar data so that users need only make one backup.

Writing your own implementation is probably the best approach, however, this package does contain a workable Datastore implementation using SQLite. This is the datastore used by NewDefaultConfig.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLiteDatastore

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

This database is mostly just an example implementation used for testing. End users are free to use their own database.

func Create

func Create(repoPath string) (*SQLiteDatastore, error)

func (*SQLiteDatastore) GetCreationDate

func (s *SQLiteDatastore) GetCreationDate() (time.Time, error)

func (*SQLiteDatastore) GetMnemonic

func (s *SQLiteDatastore) GetMnemonic() (string, error)

func (*SQLiteDatastore) SetCreationDate

func (s *SQLiteDatastore) SetCreationDate(creationDate time.Time) error

func (*SQLiteDatastore) SetMnemonic

func (s *SQLiteDatastore) SetMnemonic(mnemonic string) error

func (*SQLiteDatastore) Stxos

func (db *SQLiteDatastore) Stxos() wallet.Stxos

func (*SQLiteDatastore) Txns

func (db *SQLiteDatastore) Txns() wallet.Txns

func (*SQLiteDatastore) Utxos

func (db *SQLiteDatastore) Utxos() wallet.Utxos

func (*SQLiteDatastore) WatchedScripts

func (db *SQLiteDatastore) WatchedScripts() wallet.WatchedScripts

type StxoDB

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

func (*StxoDB) Delete

func (s *StxoDB) Delete(stxo wallet.Stxo) error

func (*StxoDB) GetAll

func (s *StxoDB) GetAll() ([]wallet.Stxo, error)

func (*StxoDB) Put

func (s *StxoDB) Put(stxo wallet.Stxo) error

type TxnsDB

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

func (*TxnsDB) Delete

func (t *TxnsDB) Delete(txid *chainhash.Hash) error

func (*TxnsDB) Get

func (t *TxnsDB) Get(txid chainhash.Hash) (wallet.Txn, error)

func (*TxnsDB) GetAll

func (t *TxnsDB) GetAll(includeWatchOnly bool) ([]wallet.Txn, error)

func (*TxnsDB) Put

func (t *TxnsDB) Put(txn []byte, txid string, value, height int, timestamp time.Time, watchOnly bool) error

func (*TxnsDB) UpdateHeight

func (t *TxnsDB) UpdateHeight(txid chainhash.Hash, height int, timestamp time.Time) error

type UtxoDB

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

func (*UtxoDB) Delete

func (u *UtxoDB) Delete(utxo wallet.Utxo) error

func (*UtxoDB) GetAll

func (u *UtxoDB) GetAll() ([]wallet.Utxo, error)

func (*UtxoDB) Lock

func (u *UtxoDB) Lock(utxo wallet.Utxo) error

func (*UtxoDB) Put

func (u *UtxoDB) Put(utxo wallet.Utxo) error

func (*UtxoDB) SetWatchOnly

func (u *UtxoDB) SetWatchOnly(utxo wallet.Utxo) error

func (*UtxoDB) Unlock

func (u *UtxoDB) Unlock(op wire.OutPoint) error

type WatchedScriptsDB

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

func (*WatchedScriptsDB) Delete

func (w *WatchedScriptsDB) Delete(scriptPubKey []byte) error

func (*WatchedScriptsDB) GetAll

func (w *WatchedScriptsDB) GetAll() ([][]byte, error)

func (*WatchedScriptsDB) Put

func (w *WatchedScriptsDB) Put(scriptPubKey []byte) error

Jump to

Keyboard shortcuts

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