Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application is the main application struct. It creates postgres datastore and consumer, and connects them together.
func NewApplication ¶
func NewApplication(params ApplicationParams) (*Application, error)
type ApplicationParams ¶
type ApplicationParams struct { PostgresDatastoreParams Libp2pHost host.Host }
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer registers to the gossipsub topic and inserts the received job info into the datastore.
func NewConsumer ¶
func NewConsumer(params ConsumerParams) *Consumer
type ConsumerParams ¶
type ConsumerParams struct { Libp2pHost host.Host Datastore *PostgresDatastore }
type PostgresDatastore ¶
type PostgresDatastore struct {
// contains filtered or unexported fields
}
PostgresDatastore is a postgres datastore. It supports migration of the database schema using go-migrate.
func NewPostgresDatastore ¶
func NewPostgresDatastore(params PostgresDatastoreParams) (*PostgresDatastore, error)
func (*PostgresDatastore) Close ¶
func (d *PostgresDatastore) Close() error
func (*PostgresDatastore) InsertJobInfo ¶
func (*PostgresDatastore) MigrateDown ¶
func (d *PostgresDatastore) MigrateDown() error
func (*PostgresDatastore) MigrateUp ¶
func (d *PostgresDatastore) MigrateUp() error
Click to show internal directories.
Click to hide internal directories.