mock

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mock provides a mock probe database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErroringService

type ErroringService struct{}

ErroringService is a mock that errors.

func NewErroring

func NewErroring() *ErroringService

NewErroring returns a mock probe database that errors.

func (*ErroringService) BeginTx

BeginTx begins a transaction.

func (*ErroringService) CommitTx

func (s *ErroringService) CommitTx(ctx context.Context) error

CommitTx commits a transaction.

func (*ErroringService) Metadata

func (s *ErroringService) Metadata(ctx context.Context, key string) ([]byte, error)

Metadata obtains the JSON value from a metadata key.

func (*ErroringService) SetAggregateAttestation added in v0.3.1

func (s *ErroringService) SetAggregateAttestation(ctx context.Context, aggregateAttestation *probedb.AggregateAttestation) error

SetAggregateAttestation sets an aggregate attestation.

func (*ErroringService) SetAttestationSummary added in v0.3.1

func (s *ErroringService) SetAttestationSummary(ctx context.Context, summary *probedb.AttestationSummary) error

SetAttestationSummary sets an attestation summary.

func (*ErroringService) SetBlockDelay

func (s *ErroringService) SetBlockDelay(ctx context.Context, delay *probedb.Delay) error

SetBlockDelay sets a block delay.

func (*ErroringService) SetHeadDelay

func (s *ErroringService) SetHeadDelay(ctx context.Context, delay *probedb.Delay) error

SetHeadDelay sets a head delay.

func (*ErroringService) SetMetadata

func (s *ErroringService) SetMetadata(ctx context.Context, key string, value []byte) error

SetMetadata sets a metadata key to a JSON value.

type Service

type Service struct{}

Service is a mock.

func New

func New() *Service

New returns a mock probe database.

func (*Service) BeginTx

BeginTx begins a transaction.

func (*Service) CommitTx

func (s *Service) CommitTx(ctx context.Context) error

CommitTx commits a transaction.

func (*Service) Metadata

func (s *Service) Metadata(ctx context.Context, key string) ([]byte, error)

Metadata obtains the JSON value from a metadata key.

func (*Service) SetAggregateAttestation added in v0.3.1

func (s *Service) SetAggregateAttestation(ctx context.Context, aggregateAttestation *probedb.AggregateAttestation) error

SetAggregateAttestation sets an aggregate attestation.

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

func (s *Service) SetBlockDelay(ctx context.Context, delay *probedb.Delay) error

SetBlockDelay sets a block delay.

func (*Service) SetHeadDelay

func (s *Service) SetHeadDelay(ctx context.Context, delay *probedb.Delay) error

SetHeadDelay sets a head delay.

func (*Service) SetMetadata

func (s *Service) SetMetadata(ctx context.Context, key string, value []byte) error

SetMetadata sets a metadata key to a JSON value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL