Documentation ¶
Index ¶
- func BoolPtr(b *bool) bool
- func MustHexDecode(input string) []byte
- func Register(schemeName string, factory DriverFactory)
- type AccountsReader
- type BlocksReader
- type BlocksTransactionsReader
- type ChainDiscriminator
- type DBReader
- type DBWriter
- type Driver
- type DriverFactory
- type GRPCConn
- type Option
- type ProtoDecoder
- type ProtoEncoder
- type TestTransactionsReader
- 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 MustHexDecode ¶
func Register ¶
func Register(schemeName string, factory DriverFactory)
Register registers a storage backend Driver
Types ¶
type AccountsReader ¶
type AccountsReader interface { GetAccount(ctx context.Context, accountName string) (*pbcodec.AccountCreationRef, error) //TODO: concurrentReadCount is that a property only for Bigtable? should it be configured when creating the driver ListAccountNames(ctx context.Context, concurrentReadCount uint32) ([]string, error) }
type BlocksReader ¶
type BlocksReader interface { 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 { SetWriterChainID(chainID []byte) // Where did I leave off last time I wrote? GetLastWrittenIrreversibleBlockRef(ctx context.Context) (ref bstream.BlockRef, err error) 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 GRPCConn ¶
type GRPCConn struct{ ClientConn *grpc.ClientConn }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithGRPCConn ¶
func WithGRPCConn(conn *grpc.ClientConn) Option
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) 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 { // GetTransactionTraces retrieves only the execution traces event, ignoring deferred lifecycle events. GetTransactionTraces(ctx context.Context, idPrefix string) ([]*pbcodec.TransactionEvent, error) // GetTransactionTracesBatch returns only the execution traces (ignoring deferred licycle events), for each id prefix specified. 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. // This function returns `kvdb.ErrNotFound` is the transaction was not found 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. GetTransactionEventsBatch(ctx context.Context, idPrefixes []string) ([][]*pbcodec.TransactionEvent, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.