Documentation ¶
Index ¶
- Variables
- type Parameter
- func WithCACert(cert []byte) Parameter
- func WithClientCert(cert []byte) Parameter
- func WithClientKey(key []byte) Parameter
- func WithLogLevel(logLevel zerolog.Level) Parameter
- func WithPassword(password string) Parameter
- func WithPort(port int32) Parameter
- func WithServer(server string) Parameter
- func WithUser(user string) Parameter
- type Service
- func (s *Service) Balances(ctx context.Context, filter *execdb.BalanceFilter) ([]*execdb.Balance, error)
- func (s *Service) BeginTx(ctx context.Context) (context.Context, context.CancelFunc, error)
- func (s *Service) BlockRewards(ctx context.Context, filter *execdb.BlockRewardFilter) ([]*execdb.BlockReward, error)
- func (s *Service) Blocks(ctx context.Context, filter *execdb.BlockFilter) ([]*execdb.Block, error)
- func (s *Service) CommitTx(ctx context.Context) error
- func (s *Service) Events(ctx context.Context, filter *execdb.EventFilter) ([]*execdb.Event, error)
- func (s *Service) Init(ctx context.Context) error
- func (s *Service) Metadata(ctx context.Context, key string) ([]byte, error)
- func (s *Service) SetBalance(ctx context.Context, balance *execdb.Balance) error
- func (s *Service) SetBalances(ctx context.Context, balances []*execdb.Balance) error
- func (s *Service) SetBlock(ctx context.Context, block *execdb.Block) error
- func (s *Service) SetBlockReward(ctx context.Context, reward *execdb.BlockReward) error
- func (s *Service) SetBlockRewards(ctx context.Context, rewards []*execdb.BlockReward) error
- func (s *Service) SetBlocks(ctx context.Context, blocks []*execdb.Block) error
- func (s *Service) SetEvent(ctx context.Context, event *execdb.Event) error
- func (s *Service) SetEvents(ctx context.Context, events []*execdb.Event) error
- func (s *Service) SetMetadata(ctx context.Context, key string, value []byte) error
- func (s *Service) SetTransaction(ctx context.Context, transaction *execdb.Transaction) error
- func (s *Service) SetTransactionStateDiff(ctx context.Context, stateDiff *execdb.TransactionStateDiff) error
- func (s *Service) SetTransactionStateDiffs(ctx context.Context, stateDiffs []*execdb.TransactionStateDiff) error
- func (s *Service) SetTransactions(ctx context.Context, transactions []*execdb.Transaction) error
- func (s *Service) Transaction(ctx context.Context, hash []byte) (*execdb.Transaction, error)
- func (s *Service) TransactionBalanceChanges(ctx context.Context, filter *execdb.TransactionBalanceChangeFilter) ([]*execdb.TransactionBalanceChange, error)
- func (s *Service) TransactionStateDiff(ctx context.Context, hash []byte) (*execdb.TransactionStateDiff, error)
- func (s *Service) Transactions(ctx context.Context, filter *execdb.TransactionFilter) ([]*execdb.Transaction, error)
- func (s *Service) Upgrade(ctx context.Context) error
- type Tx
Constants ¶
This section is empty.
Variables ¶
var ErrNoTransaction = errors.New("no transaction for action")
ErrNoTransaction is returned when an attempt to carry out a mutation to the database is not inside a transaction.
Functions ¶
This section is empty.
Types ¶
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithCACert ¶
WithCACert sets the bytes of the certificate authority TLS certificate.
func WithClientCert ¶
WithClientCert sets the bytes of the client TLS certificate.
func WithClientKey ¶
WithClientKey sets the bytes of the client TLS key.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithPassword ¶
WithPassword sets the password for this module.
func WithServer ¶
WithServer sets the server for this module.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is an execution database service.
func (*Service) Balances ¶ added in v0.3.6
func (s *Service) Balances(ctx context.Context, filter *execdb.BalanceFilter) ([]*execdb.Balance, error)
Balances returns balances matching the supplied filter.
func (*Service) BeginTx ¶
BeginTx begins a transaction on the database. The transaction can be rolled back by invoking the cancel function.
func (*Service) BlockRewards ¶ added in v0.5.1
func (s *Service) BlockRewards(ctx context.Context, filter *execdb.BlockRewardFilter) ([]*execdb.BlockReward, error)
BlockRewards returns block rewards matching the supplied filter.
func (*Service) SetBalance ¶ added in v0.3.6
SetBalance sets a balance.
func (*Service) SetBalances ¶ added in v0.3.6
SetBalances sets multiple balances efficiently.
func (*Service) SetBlockReward ¶ added in v0.4.1
SetBlockReward sets a block's reward.
func (*Service) SetBlockRewards ¶ added in v0.4.1
SetBlockRewards sets multiple block rewards efficiently.
func (*Service) SetMetadata ¶
SetMetadata sets a metadata key to a JSON value.
func (*Service) SetTransaction ¶
SetTransaction sets a transaction.
func (*Service) SetTransactionStateDiff ¶
func (s *Service) SetTransactionStateDiff(ctx context.Context, stateDiff *execdb.TransactionStateDiff) error
SetTransactionStateDiff sets a transaction's state differences.
func (*Service) SetTransactionStateDiffs ¶
func (s *Service) SetTransactionStateDiffs(ctx context.Context, stateDiffs []*execdb.TransactionStateDiff) error
SetTransactionStateDiffs sets multiple transactions' state differences efficiently.
func (*Service) SetTransactions ¶
SetTransactions sets multiple transactions efficiently.
func (*Service) Transaction ¶ added in v0.3.1
Transaction returns the transaction matching the supplied hash.
func (*Service) TransactionBalanceChanges ¶ added in v0.4.9
func (s *Service) TransactionBalanceChanges(ctx context.Context, filter *execdb.TransactionBalanceChangeFilter) ([]*execdb.TransactionBalanceChange, error)
TransactionBalanceChanges returns transaction balance changes matching the supplied filter.
func (*Service) TransactionStateDiff ¶ added in v0.3.1
func (s *Service) TransactionStateDiff(ctx context.Context, hash []byte) (*execdb.TransactionStateDiff, error)
TransactionStateDiff returns transaction state diffs for the supplied hash.
func (*Service) Transactions ¶
func (s *Service) Transactions(ctx context.Context, filter *execdb.TransactionFilter) ([]*execdb.Transaction, error)
Transactions returns transactions matching the supplied filter.
Source Files ¶
- balances.go
- blockrewards.go
- blocks.go
- events.go
- metadata.go
- parameters.go
- service.go
- setbalance.go
- setbalances.go
- setblock.go
- setblockreward.go
- setblockrewards.go
- setblocks.go
- setevent.go
- setevents.go
- settransaction.go
- settransactions.go
- settransactionstatediff.go
- settransactionstatediffs.go
- transaction.go
- transactionbalancechanges.go
- transactions.go
- transactionstatediff.go
- tx.go
- upgrader.go