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) BeginTx(ctx context.Context) (context.Context, context.CancelFunc, 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) SetBlock(ctx context.Context, block *execdb.Block) 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) 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 is returned when an attempt to carry out a mutation to the database // is not inside a transaction. ErrNoTransaction = errors.New("no transaction for action") )
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) BeginTx ¶
BeginTx begins a transaction on the database. The transaction can be rolled back by invoking the cancel function.
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) Transactions ¶
func (s *Service) Transactions(ctx context.Context, filter *execdb.TransactionFilter) ([]*execdb.Transaction, error)
Transactions returns transactions matching the supplied filter.