Documentation ¶
Index ¶
- type BlockStorer
- type ChainMemoryStore
- type ChainMongoStore
- type MemoryBlockStore
- type MemoryTxStore
- type MemoryUTXOStore
- func (m *MemoryUTXOStore) Get(ctx context.Context, key string) (*proto.UTXO, error)
- func (m *MemoryUTXOStore) GetByAddress(ctx context.Context, address []byte) ([]*proto.UTXO, error)
- func (m *MemoryUTXOStore) List(ctx context.Context) []*proto.UTXO
- func (m *MemoryUTXOStore) Put(ctx context.Context, utxo *proto.UTXO) error
- type MongoBlockStore
- type MongoTxStore
- type MongoUTXOStore
- func (m *MongoUTXOStore) Get(ctx context.Context, key string) (*proto.UTXO, error)
- func (m *MongoUTXOStore) GetByAddress(ctx context.Context, address []byte) ([]*proto.UTXO, error)
- func (m *MongoUTXOStore) List(ctx context.Context) []*proto.UTXO
- func (m *MongoUTXOStore) Put(ctx context.Context, utxo *proto.UTXO) error
- type Storer
- type TxStorer
- type UTXOStorer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStorer ¶
type ChainMemoryStore ¶
type ChainMemoryStore struct {
// contains filtered or unexported fields
}
func (*ChainMemoryStore) BlockStore ¶
func (c *ChainMemoryStore) BlockStore(ctx context.Context) BlockStorer
func (*ChainMemoryStore) UTXOStore ¶
func (c *ChainMemoryStore) UTXOStore(ctx context.Context) UTXOStorer
type ChainMongoStore ¶
type ChainMongoStore struct {
// contains filtered or unexported fields
}
func (*ChainMongoStore) BlockStore ¶
func (c *ChainMongoStore) BlockStore(ctx context.Context) BlockStorer
func (*ChainMongoStore) UTXOStore ¶
func (c *ChainMongoStore) UTXOStore(ctx context.Context) UTXOStorer
type MemoryBlockStore ¶
type MemoryBlockStore struct {
// contains filtered or unexported fields
}
func NewMemoryBlockStore ¶
func NewMemoryBlockStore() *MemoryBlockStore
type MemoryTxStore ¶
type MemoryTxStore struct {
// contains filtered or unexported fields
}
MemoryTxStore
func NewMemoryTxStore ¶
func NewMemoryTxStore() *MemoryTxStore
func (*MemoryTxStore) Get ¶
func (m *MemoryTxStore) Get(ctx context.Context, txHash string) (*proto.Transaction, error)
func (*MemoryTxStore) List ¶
func (m *MemoryTxStore) List(ctx context.Context) []*proto.Transaction
func (*MemoryTxStore) Put ¶
func (m *MemoryTxStore) Put(ctx context.Context, tx *proto.Transaction) error
type MemoryUTXOStore ¶
type MemoryUTXOStore struct {
// contains filtered or unexported fields
}
func NewMemoryUTXOStore ¶
func NewMemoryUTXOStore() *MemoryUTXOStore
func (*MemoryUTXOStore) GetByAddress ¶
type MongoBlockStore ¶
type MongoBlockStore struct {
// contains filtered or unexported fields
}
func NewMongoBlockStore ¶
func NewMongoBlockStore(client *mongo.Client) *MongoBlockStore
func (*MongoBlockStore) Get ¶
Get retrieves a block from the database, implementing the BlockStorer interface.
type MongoTxStore ¶
type MongoTxStore struct {
// contains filtered or unexported fields
}
MongoTxStore
func NewMongoTxStore ¶
func NewMongoTxStore(client *mongo.Client) *MongoTxStore
func (*MongoTxStore) Get ¶
func (m *MongoTxStore) Get(ctx context.Context, txHash string) (*proto.Transaction, error)
Get retrieves transaction from the store, implements TxStorer interface
func (*MongoTxStore) List ¶
func (m *MongoTxStore) List(ctx context.Context) []*proto.Transaction
List retrieves all transactions from the store, implements TxStorer interface
func (*MongoTxStore) Put ¶
func (m *MongoTxStore) Put(ctx context.Context, tx *proto.Transaction) error
Put inserts transaction into the store, implements TxStorer interface
type MongoUTXOStore ¶
type MongoUTXOStore struct {
// contains filtered or unexported fields
}
func NewMongoUTXOStore ¶
func NewMongoUTXOStore(client *mongo.Client) *MongoUTXOStore
func (*MongoUTXOStore) GetByAddress ¶
GetByAddress retrieves all UTXOs for a given address from the store, implements UTXOStorer interface
type Storer ¶
type Storer interface { UTXOStore(context.Context) UTXOStorer TxStore(context.Context) TxStorer BlockStore(context.Context) BlockStorer }
func NewChainMemoryStore ¶
func NewChainMemoryStore() Storer
func NewChainMongoStore ¶
func NewChainStore ¶
Click to show internal directories.
Click to hide internal directories.