db

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 32 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt() error

Create a temp database, read the encrypted database into it then replace the encrypted database

func Encrypt

func Encrypt() error

Create a temp encrypted database, read the unencrypted database into it then replace the unencrypted database

Types

type ConfigDB

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

func (*ConfigDB) GetIdentityKey

func (c *ConfigDB) GetIdentityKey() ([]byte, error)

func (*ConfigDB) GetMnemonic

func (c *ConfigDB) GetMnemonic() (string, error)

func (*ConfigDB) Init

func (c *ConfigDB) Init(mnemonic string, identityKey []byte, password string) error

func (*ConfigDB) IsEncrypted

func (c *ConfigDB) IsEncrypted() bool

type FollowerDB

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

func (*FollowerDB) Count

func (f *FollowerDB) Count() int

func (*FollowerDB) Delete

func (f *FollowerDB) Delete(follower string) error

func (*FollowerDB) FollowsMe added in v0.2.0

func (f *FollowerDB) FollowsMe(peerId string) bool

func (*FollowerDB) Get

func (f *FollowerDB) Get(offsetId string, limit int) ([]string, error)

func (*FollowerDB) Put

func (f *FollowerDB) Put(follower string) error

type FollowingDB

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

func (*FollowingDB) Count

func (f *FollowingDB) Count() int

func (*FollowingDB) Delete

func (f *FollowingDB) Delete(follower string) error

func (*FollowingDB) Get

func (f *FollowingDB) Get(offsetId string, limit int) ([]string, error)

func (*FollowingDB) IsFollowing added in v0.2.0

func (f *FollowingDB) IsFollowing(peerId string) bool

func (*FollowingDB) Put

func (f *FollowingDB) Put(follower string) error

type InventoryDB

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

func (*InventoryDB) Delete

func (i *InventoryDB) Delete(path string) error

func (*InventoryDB) DeleteAll added in v0.1.1

func (i *InventoryDB) DeleteAll(slug string) error

func (*InventoryDB) Get

func (i *InventoryDB) Get(slug string) (map[string]int, error)

func (*InventoryDB) GetAll

func (i *InventoryDB) GetAll() (map[string]int, error)

func (*InventoryDB) GetSpecific added in v0.1.1

func (i *InventoryDB) GetSpecific(path string) (int, error)

func (*InventoryDB) Put

func (i *InventoryDB) Put(slug string, count int) error

type KeysDB

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

func (*KeysDB) GetAll

func (k *KeysDB) GetAll() ([]spvwallet.KeyPath, error)

func (*KeysDB) GetLastKeyIndex

func (k *KeysDB) GetLastKeyIndex(purpose spvwallet.KeyPurpose) (int, bool, error)

func (*KeysDB) GetLookaheadWindows

func (k *KeysDB) GetLookaheadWindows() map[spvwallet.KeyPurpose]int

func (*KeysDB) GetPathForScript

func (k *KeysDB) GetPathForScript(scriptPubKey []byte) (spvwallet.KeyPath, error)

func (*KeysDB) GetUnused

func (k *KeysDB) GetUnused(purpose spvwallet.KeyPurpose) (int, error)

func (*KeysDB) MarkKeyAsUsed

func (k *KeysDB) MarkKeyAsUsed(scriptPubKey []byte) error

func (*KeysDB) Put

func (k *KeysDB) Put(scriptPubKey []byte, keyPath spvwallet.KeyPath) error

type OfflineMessagesDB

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

func (*OfflineMessagesDB) Has

func (o *OfflineMessagesDB) Has(url string) bool

func (*OfflineMessagesDB) Put

func (o *OfflineMessagesDB) Put(url string) error

type PointersDB

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

func (*PointersDB) Delete

func (p *PointersDB) Delete(id peer.ID) error

func (*PointersDB) DeleteAll added in v0.1.1

func (p *PointersDB) DeleteAll(purpose ipfs.Purpose) error

func (*PointersDB) GetAll

func (p *PointersDB) GetAll() ([]ipfs.Pointer, error)

func (*PointersDB) Put

func (p *PointersDB) Put(pointer ipfs.Pointer) error

type PurchasesDB added in v0.1.2

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

func (*PurchasesDB) Delete added in v0.1.2

func (p *PurchasesDB) Delete(orderID string) error

func (*PurchasesDB) GetAll added in v0.1.2

func (p *PurchasesDB) GetAll() ([]string, error)

func (*PurchasesDB) GetByOrderId added in v0.2.0

func (*PurchasesDB) GetByPaymentAddress added in v0.2.0

func (p *PurchasesDB) GetByPaymentAddress(addr btc.Address) (*pb.RicardianContract, pb.OrderState, bool, []*spvwallet.TransactionRecord, error)

func (*PurchasesDB) MarkAsRead added in v0.1.2

func (p *PurchasesDB) MarkAsRead(orderID string) error

func (*PurchasesDB) Put added in v0.1.2

func (p *PurchasesDB) Put(orderID string, contract pb.RicardianContract, state pb.OrderState, read bool) error

func (*PurchasesDB) UpdateFunding added in v0.2.0

func (p *PurchasesDB) UpdateFunding(orderId string, funded bool, records []*spvwallet.TransactionRecord) error

type SQLiteDatastore

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

func Create

func Create(repoPath, password string, testnet bool) (*SQLiteDatastore, error)

func (*SQLiteDatastore) Close

func (d *SQLiteDatastore) Close()

func (*SQLiteDatastore) Config

func (d *SQLiteDatastore) Config() repo.Config

func (*SQLiteDatastore) Copy

func (d *SQLiteDatastore) Copy(dbPath string, password string) error

func (*SQLiteDatastore) Followers

func (d *SQLiteDatastore) Followers() repo.Followers

func (*SQLiteDatastore) Following

func (d *SQLiteDatastore) Following() repo.Following

func (*SQLiteDatastore) Inventory

func (d *SQLiteDatastore) Inventory() repo.Inventory

func (*SQLiteDatastore) Keys

func (d *SQLiteDatastore) Keys() spvwallet.Keys

func (*SQLiteDatastore) OfflineMessages

func (d *SQLiteDatastore) OfflineMessages() repo.OfflineMessages

func (*SQLiteDatastore) Pointers

func (d *SQLiteDatastore) Pointers() repo.Pointers

func (*SQLiteDatastore) Purchases added in v0.1.2

func (d *SQLiteDatastore) Purchases() repo.Purchases

func (*SQLiteDatastore) Sales added in v0.1.2

func (d *SQLiteDatastore) Sales() repo.Sales

func (*SQLiteDatastore) Settings

func (d *SQLiteDatastore) Settings() repo.Settings

func (*SQLiteDatastore) State

func (d *SQLiteDatastore) State() spvwallet.State

func (*SQLiteDatastore) Stxos

func (d *SQLiteDatastore) Stxos() spvwallet.Stxos

func (*SQLiteDatastore) Txns

func (d *SQLiteDatastore) Txns() spvwallet.Txns

func (*SQLiteDatastore) Utxos

func (d *SQLiteDatastore) Utxos() spvwallet.Utxos

func (*SQLiteDatastore) WatchedScripts added in v0.2.0

func (d *SQLiteDatastore) WatchedScripts() spvwallet.WatchedScripts

type SalesDB added in v0.1.2

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

func (*SalesDB) Delete added in v0.1.2

func (s *SalesDB) Delete(orderID string) error

func (*SalesDB) GetAll added in v0.1.2

func (s *SalesDB) GetAll() ([]string, error)

func (*SalesDB) GetByOrderId added in v0.2.0

func (*SalesDB) GetByPaymentAddress added in v0.2.0

func (s *SalesDB) GetByPaymentAddress(addr btc.Address) (*pb.RicardianContract, pb.OrderState, bool, []*spvwallet.TransactionRecord, error)

func (*SalesDB) MarkAsRead added in v0.1.2

func (s *SalesDB) MarkAsRead(orderID string) error

func (*SalesDB) Put added in v0.1.2

func (s *SalesDB) Put(orderID string, contract pb.RicardianContract, state pb.OrderState, read bool) error

func (*SalesDB) UpdateFunding added in v0.2.0

func (s *SalesDB) UpdateFunding(orderId string, funded bool, records []*spvwallet.TransactionRecord) error

type SettingsDB

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

func (*SettingsDB) Delete added in v0.2.4

func (s *SettingsDB) Delete() error

Delete removes all settings from the database. It's a destructive action that should be used with care.

func (*SettingsDB) Get

func (s *SettingsDB) Get() (repo.SettingsData, error)

func (*SettingsDB) Put

func (s *SettingsDB) Put(settings repo.SettingsData) error

func (*SettingsDB) Update

func (s *SettingsDB) Update(settings repo.SettingsData) error

type StateDB

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

func (*StateDB) Get

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

func (*StateDB) Put

func (s *StateDB) Put(key, value string) error

type StxoDB

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

func (*StxoDB) Delete

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

func (*StxoDB) GetAll

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

func (*StxoDB) Put

func (s *StxoDB) Put(stxo spvwallet.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) (*wire.MsgTx, error)

func (*TxnsDB) GetAll

func (t *TxnsDB) GetAll() ([]*wire.MsgTx, error)

func (*TxnsDB) Put

func (t *TxnsDB) Put(txn *wire.MsgTx) error

type UtxoDB

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

func (*UtxoDB) Delete

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

func (*UtxoDB) Freeze added in v0.2.0

func (u *UtxoDB) Freeze(utxo spvwallet.Utxo) error

func (*UtxoDB) GetAll

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

func (*UtxoDB) Put

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

type WatchedScriptsDB added in v0.2.0

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

func (*WatchedScriptsDB) Delete added in v0.2.0

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

func (*WatchedScriptsDB) GetAll added in v0.2.0

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

func (*WatchedScriptsDB) Put added in v0.2.0

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