Documentation ¶
Index ¶
- func NewDefaultDatabaseMigratorInitializationError(err error) error
- func NewDefaultDatabaseMigratorMigrationError(err error) error
- func NewDefaultManagerBidsCreationError(err error) error
- func NewDefaultManagerRelaysCreationError(err error) error
- func NewDefaultManagerRelaysListingError(err error) error
- func NewDefaultManagerSubmissionsCreationError(err error) error
- func NewDefaultManagerTransactionedBidsSubmissionsCreationError(err error) error
- func NewDefaultManagerTransactionedRelaysCreationError(err error) error
- type DatabaseMigrator
- type DefaultDatabaseMigrator
- type DefaultManager
- func (manager *DefaultManager) Init(store store.Store)
- func (manager *DefaultManager) Shutdown()
- func (manager *DefaultManager) StoreAggregatedRelayData(ctx context.Context, data *common.DataPreprocessorOutput) error
- func (manager *DefaultManager) StoreRelays(ctx context.Context, data []*dto.Relay) error
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultDatabaseMigratorInitializationError ¶
NewDefaultDatabaseMigratorInitializationError is raised if the DefaultDatabaseMigrator encounters an error during the initialization process.
func NewDefaultDatabaseMigratorMigrationError ¶
NewDefaultDatabaseMigratorMigrationError is raised when the DefaultDatabaseMigrator fails to apply the database migrations.
func NewDefaultManagerBidsCreationError ¶
NewDefaultManagerBidsCreationError is raised if the DefaultManager encounters an error while creating a list of bid entity in the database.
func NewDefaultManagerRelaysCreationError ¶
NewDefaultManagerRelaysCreationError is raised if the DefaultManager encounters an error while creating a relay entity in the database.
func NewDefaultManagerSubmissionsCreationError ¶
NewDefaultManagerSubmissionsCreationError is raised if the DefaultManager encounters an error while creating a list of submission entity in the database.
func NewDefaultManagerTransactionedBidsSubmissionsCreationError ¶
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 ¶
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 ¶
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.