storage

package
v0.0.0-...-663aea3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultDatabaseMigratorInitializationError

func NewDefaultDatabaseMigratorInitializationError(err error) error

NewDefaultDatabaseMigratorInitializationError is raised if the DefaultDatabaseMigrator encounters an error during the initialization process.

func NewDefaultDatabaseMigratorMigrationError

func NewDefaultDatabaseMigratorMigrationError(err error) error

NewDefaultDatabaseMigratorMigrationError is raised when the DefaultDatabaseMigrator fails to apply the database migrations.

func NewDefaultManagerBidsCreationError

func NewDefaultManagerBidsCreationError(err error) error

NewDefaultManagerBidsCreationError is raised if the DefaultManager encounters an error while creating a list of bid entity in the database.

func NewDefaultManagerRelaysCreationError

func NewDefaultManagerRelaysCreationError(err error) error

NewDefaultManagerRelaysCreationError is raised if the DefaultManager encounters an error while creating a relay entity in the database.

func NewDefaultManagerRelaysListingError

func NewDefaultManagerRelaysListingError(err error) error

func NewDefaultManagerSubmissionsCreationError

func NewDefaultManagerSubmissionsCreationError(err error) error

NewDefaultManagerSubmissionsCreationError is raised if the DefaultManager encounters an error while creating a list of submission entity in the database.

func NewDefaultManagerTransactionedBidsSubmissionsCreationError

func NewDefaultManagerTransactionedBidsSubmissionsCreationError(err error) error

NewDefaultManagerTransactionedBidsSubmissionsCreationError is raised if the DefaultManager encounters an error while executing the transaction responsible for storing multiple bids and their submissions in the database.

func NewDefaultManagerTransactionedRelaysCreationError

func NewDefaultManagerTransactionedRelaysCreationError(err error) error

NewDefaultManagerTransactionedRelaysCreationError is raised if the DefaultManager encounters an error while executing the transaction responsible for storing multiple relays in the database.

Types

type DatabaseMigrator

type DatabaseMigrator interface {
	// Migrate is used to migrate the schemas in db/migrations.
	Migrate() error
}

The DatabaseMigrator is used to apply the database migrations, ideally at the indexer's startup.

type DefaultDatabaseMigrator

type DefaultDatabaseMigrator struct {
	// contains filtered or unexported fields
}

The DefaultDatabaseMigrator is an implementation of the DatabaseMigrator which applies the migrations to a Postgres database.

func NewDefaultDatabaseMigrator

func NewDefaultDatabaseMigrator() *DefaultDatabaseMigrator

NewDefaultDatabaseMigrator creates an empty and non-initialized DefaultDatabaseMigrator.

func (*DefaultDatabaseMigrator) Init

func (migrator *DefaultDatabaseMigrator) Init(sourceURL, databaseURL string) error

Init initializes a DefaultDatabaseMigrator given the migrations source and the database URL.

func (*DefaultDatabaseMigrator) Migrate

func (migrator *DefaultDatabaseMigrator) Migrate() error

type DefaultManager

type DefaultManager struct {
	// contains filtered or unexported fields
}

The DefaultManager is an implementation of the Manager using the default store.

func NewDefaultManager

func NewDefaultManager() *DefaultManager

NewDefaultManager creates an empty and non-initialized DefaultManager.

func (*DefaultManager) Init

func (manager *DefaultManager) Init(store store.Store)

Init initializes a DefaultManager given the store used to perform database operations.

func (*DefaultManager) Shutdown

func (manager *DefaultManager) Shutdown()

func (*DefaultManager) StoreAggregatedRelayData

func (manager *DefaultManager) StoreAggregatedRelayData(
	ctx context.Context,
	data *common.DataPreprocessorOutput,
) error

func (*DefaultManager) StoreRelays

func (manager *DefaultManager) StoreRelays(
	ctx context.Context,
	data []*dto.Relay,
) error

type Manager

type Manager interface {
	// StoreRelays is used to store the relay entities at Agate's startup.
	StoreRelays(ctx context.Context, relays []*dto.Relay) error
	// StoreAggregatedRelayData is used to store the preprocessed aggregated relay data once
	// received by the data aggregator.
	StoreAggregatedRelayData(ctx context.Context, data *common.DataPreprocessorOutput) error
	// Shutdown stops the manager sub-services.
	Shutdown()
}

The Manager is used to store preprocessed aggregated relay data into a database.

Directories

Path Synopsis
dto

Jump to

Keyboard shortcuts

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