Documentation ¶
Overview ¶
Package postgresql provides a postgresql implementation of the probe database.
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) AggregateAttestations(ctx context.Context, filter *probedb.AggregateAttestationFilter) ([]*probedb.AggregateAttestation, error)
- func (s *Service) AttestationSummaries(ctx context.Context, filter *probedb.AttestationSummaryFilter) ([]*probedb.AttestationSummary, error)
- func (s *Service) BeginTx(ctx context.Context) (context.Context, context.CancelFunc, error)
- func (s *Service) BlockDelays(ctx context.Context, filter *probedb.DelayFilter) ([]*probedb.Delay, error)
- func (s *Service) CommitTx(ctx context.Context) error
- func (s *Service) HeadDelays(ctx context.Context, filter *probedb.DelayFilter) ([]*probedb.Delay, error)
- func (s *Service) Init(ctx context.Context) error
- func (s *Service) Metadata(ctx context.Context, key string) ([]byte, error)
- func (s *Service) SetAggregateAttestation(ctx context.Context, aggregateAttestation *probedb.AggregateAttestation) error
- func (s *Service) SetAttestationSummary(ctx context.Context, summary *probedb.AttestationSummary) error
- func (s *Service) SetBlockDelay(ctx context.Context, delay *probedb.Delay) error
- func (s *Service) SetHeadDelay(ctx context.Context, delay *probedb.Delay) error
- func (s *Service) SetMetadata(ctx context.Context, key string, value []byte) 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 a chain database service.
func (*Service) AggregateAttestations ¶ added in v0.3.1
func (s *Service) AggregateAttestations( ctx context.Context, filter *probedb.AggregateAttestationFilter, ) ( []*probedb.AggregateAttestation, error, )
AggregateAttestations obtains the aggregate attestations for a given filter.
func (*Service) AttestationSummaries ¶ added in v0.3.1
func (s *Service) AttestationSummaries(ctx context.Context, filter *probedb.AttestationSummaryFilter, ) ( []*probedb.AttestationSummary, error, )
AttestationSummaries obtains the attestation summaries for a filter.
func (*Service) BeginTx ¶
BeginTx begins a transaction on the database. The transaction can be rolled back by invoking the cancel function.
func (*Service) BlockDelays ¶
func (s *Service) BlockDelays( ctx context.Context, filter *probedb.DelayFilter, ) ( []*probedb.Delay, error, )
BlockDelays obtains the block delays for a range of slots.
func (*Service) HeadDelays ¶
func (s *Service) HeadDelays( ctx context.Context, filter *probedb.DelayFilter, ) ( []*probedb.Delay, error, )
HeadDelays obtains the head delays for a range of slots.
func (*Service) SetAggregateAttestation ¶ added in v0.3.1
func (s *Service) SetAggregateAttestation(ctx context.Context, aggregateAttestation *probedb.AggregateAttestation) error
SetAggregateAttestation sets an aggregate attestation. If an aggregate attestation already exists then ignore it.
func (*Service) SetAttestationSummary ¶ added in v0.3.1
func (s *Service) SetAttestationSummary(ctx context.Context, summary *probedb.AttestationSummary) error
SetAttestationSummary sets an attestation summary.
func (*Service) SetBlockDelay ¶
SetBlockDelay sets a block delay. If a delay already exists for this block then ignore it.
func (*Service) SetHeadDelay ¶
SetHeadDelay sets a head delay. If a delay already exists for this head then ignore it.
func (*Service) SetMetadata ¶
SetMetadata sets a metadata key to a JSON value.