store

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// ExecInTx is used to perform a set of operations wrapped in a function in a single database
	// transaction. If one of them fails, the preceding operations all revert.
	//
	// Note that the database operations performed in the function callback should be made using
	// the store parameter of the said callback.
	ExecInTx(ctx context.Context, fn func(store Store) error) error

	// CreateRelays is used to create multiple relay entities in the database.
	CreateRelays(ctx context.Context, relays []*models.Relay) error
	// ListRelays is used to list all the relay entities stored in the database.
	ListRelays(ctx context.Context) ([]models.Relay, error)

	// CreateBids is used to create multiple bid entities in the database.
	CreateBids(ctx context.Context, bids []*models.Bid) error

	// CreateSubmissions is used to create multiple submission entities in the database.
	CreateSubmissions(ctx context.Context, submissions []*models.Submission) error

	// Close is used to shut down the connection from the Store to the database.
	Close()
}

Store is used to perform storage operations with a database. It should be used by the storage manager as the intermediate when interacting with the database.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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