Documentation ¶
Index ¶
- func BoolPtr(b *bool) bool
- func IsRegistered(schemeName string) bool
- func MustHexDecode(input string) []byte
- func Register(schemeName string, factory DriverFactory)
- type AccountsReader
- type BlocksReader
- type BlocksTransactionsReader
- type ChainDiscriminator
- type DB
- type DBReader
- type DBWriter
- type Debugeable
- type DriverFactory
- type IndexableCategories
- type Option
- type ProtoDecoder
- type ProtoEncoder
- type TestTransactionsReader
- func (r *TestTransactionsReader) GetLastWrittenIrreversibleBlockRef(ctx context.Context) (ref bstream.BlockRef, err error)
- func (r *TestTransactionsReader) GetTransactionEvents(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error)
- func (r *TestTransactionsReader) GetTransactionEventsBatch(ctx context.Context, idPrefixes []string) ([][]*pbcodec.TransactionEvent, error)
- func (r *TestTransactionsReader) GetTransactionTraces(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error)
- func (r *TestTransactionsReader) GetTransactionTracesBatch(ctx context.Context, idPrefixes []string) (out [][]*pbcodec.TransactionEvent, err error)
- type TimelineExplorer
- type TransactionsReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRegistered ¶
func MustHexDecode ¶
func Register ¶
func Register(schemeName string, factory DriverFactory)
Register registers a storage backend DB
Types ¶
type AccountsReader ¶
type BlocksReader ¶
type BlocksReader interface { GetLastWrittenIrreversibleBlockRef(ctx context.Context) (ref bstream.BlockRef, err error) GetLastWrittenBlockID(ctx context.Context) (blockID string, err error) GetBlock(ctx context.Context, id string) (*pbcodec.BlockWithRefs, error) GetBlockByNum(ctx context.Context, num uint32) ([]*pbcodec.BlockWithRefs, error) GetClosestIrreversibleIDAtBlockNum(ctx context.Context, num uint32) (ref bstream.BlockRef, err error) GetIrreversibleIDAtBlockID(ctx context.Context, ID string) (ref bstream.BlockRef, err error) // ListBlocks retrieves blocks where `highBlockNum` is the highest // returned, and will retrieve a maximum of `limit` rows. For // example, if you pass `highBlockNum = math.MaxUint32` with // `limit = 1`, it will retrieve the last written block. // // FIXME: this one should be `lowBlockNum` and `highBlockNum`, the // thing is you might not have the expected block range if there // are forked blocks provided. ListBlocks(ctx context.Context, highBlockNum uint32, limit int) ([]*pbcodec.BlockWithRefs, error) ListSiblingBlocks(ctx context.Context, blockNum uint32, spread uint32) ([]*pbcodec.BlockWithRefs, error) }
type BlocksTransactionsReader ¶
type BlocksTransactionsReader interface { BlocksReader TransactionsReader }
This is the main interface, needed by most subsystems.
type ChainDiscriminator ¶
type DBReader ¶
type DBReader interface { BlocksReader TransactionsReader AccountsReader TimelineExplorer }
type DBWriter ¶
type DBWriter interface { // this is used to bootstrap the trxdb-loader pipeline GetLastWrittenIrreversibleBlockRef(ctx context.Context) (ref bstream.BlockRef, err error) SetWriterChainID(chainID []byte) PutBlock(ctx context.Context, blk *pbcodec.Block) error UpdateNowIrreversibleBlock(ctx context.Context, blk *pbcodec.Block) error // Flush MUST be called or you WILL lose data Flush(context.Context) error }
type Debugeable ¶
type Debugeable interface {
Dump()
}
type DriverFactory ¶
type IndexableCategories ¶
type IndexableCategories []pbtrxdb.IndexableCategory
var FullIndexing IndexableCategories
var NoIndexing IndexableCategories = nil
func NewIndexableCategories ¶
func NewIndexableCategories(in string) (out IndexableCategories, err error)
func (IndexableCategories) AsHumanKeys ¶
func (i IndexableCategories) AsHumanKeys() (out []string)
func (IndexableCategories) ToMap ¶
func (i IndexableCategories) ToMap() map[pbtrxdb.IndexableCategory]bool
type ProtoDecoder ¶
type ProtoDecoder struct{}
func NewProtoDecoder ¶
func NewProtoDecoder() *ProtoDecoder
type ProtoEncoder ¶
type ProtoEncoder struct{}
func NewProtoEncoder ¶
func NewProtoEncoder() *ProtoEncoder
type TestTransactionsReader ¶
type TestTransactionsReader struct {
// contains filtered or unexported fields
}
func NewTestTransactionsReader ¶
func NewTestTransactionsReader(content map[string][]*pbcodec.TransactionEvent) *TestTransactionsReader
func (*TestTransactionsReader) GetLastWrittenIrreversibleBlockRef ¶
func (*TestTransactionsReader) GetTransactionEvents ¶
func (r *TestTransactionsReader) GetTransactionEvents(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error)
func (*TestTransactionsReader) GetTransactionEventsBatch ¶
func (r *TestTransactionsReader) GetTransactionEventsBatch(ctx context.Context, idPrefixes []string) ([][]*pbcodec.TransactionEvent, error)
func (*TestTransactionsReader) GetTransactionTraces ¶
func (r *TestTransactionsReader) GetTransactionTraces(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error)
func (*TestTransactionsReader) GetTransactionTracesBatch ¶
func (r *TestTransactionsReader) GetTransactionTracesBatch(ctx context.Context, idPrefixes []string) (out [][]*pbcodec.TransactionEvent, err error)
type TimelineExplorer ¶
type TimelineExplorer interface { BlockIDAt(ctx context.Context, start time.Time) (id string, err error) BlockIDAfter(ctx context.Context, start time.Time, inclusive bool) (id string, foundtime time.Time, err error) BlockIDBefore(ctx context.Context, start time.Time, inclusive bool) (id string, foundtime time.Time, err error) }
type TransactionsReader ¶
type TransactionsReader interface { GetLastWrittenIrreversibleBlockRef(ctx context.Context) (ref bstream.BlockRef, err error) // GetTransactionTraces retrieves only the execution traces event, ignoring deferred lifecycle events. // It can return a nil list of TransactionEvent with no error, if nothing was found. // It will return an error if the idPrefix matches multiple transactions (e.g. is too short) GetTransactionTraces(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error) // GetTransactionTracesBatch returns only the execution traces, ignoring deferred lifecycle events, for each id prefix specified. // If some ids are not found, the corresponding index will have a nil list of TransactionEvent. // It will return an error if one of the the idPrefixes matches multiple transactions (e.g. is too short) GetTransactionTracesBatch(ctx context.Context, idPrefixes []string) ([][]*pbcodec.TransactionEvent, error) // GetTransactionEvents retrieves all the events related to the lifecycle of a transaction, including transaction introduction, deferred creations, cancellations, and traces of execution. // It can return a nil list of TransactionEvent with no error, if nothing was found. // It will return an error if the idPrefix matches multiple transactions (e.g. is too short) GetTransactionEvents(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error) // GetTransactionEventsBatch returns a list of all events for each transaction id prefix. // If some ids are not found, the corresponding index will have a nil list of TransactionEvent. // It will return an error if one of the the idPrefixes matches multiple transactions (e.g. is too short) GetTransactionEventsBatch(ctx context.Context, idPrefixes []string) ([][]*pbcodec.TransactionEvent, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.