Documentation ¶
Index ¶
- type AppBuilder
- func (ab *AppBuilder) AppName() string
- func (ab *AppBuilder) BuildApp() *BaseApp
- func (ab *AppBuilder) RegisterDB(db ethdb.KeyValueStore)
- func (ab *AppBuilder) RegisterEthClient(ethClient eth.Client)
- func (ab *AppBuilder) RegisterHTTPHandler(handler *server.Handler) error
- func (ab *AppBuilder) RegisterHTTPServer(svr *server.Server)
- func (ab *AppBuilder) RegisterJob(job job.Basic)
- func (ab *AppBuilder) RegisterMetrics(cfg *telemetry.Config) error
- func (ab *AppBuilder) RegisterMiddleware(m server.Middleware) error
- type BaseApp
- type JobManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppBuilder ¶
type AppBuilder struct {
// contains filtered or unexported fields
}
AppBuilder is a builder for an app.
func NewAppBuilder ¶
func NewAppBuilder(appName string, logger log.Logger) *AppBuilder
NewAppBuilder creates a new app builder.
func (*AppBuilder) AppName ¶
func (ab *AppBuilder) AppName() string
AppName returns the name of the app.
func (*AppBuilder) RegisterDB ¶
func (ab *AppBuilder) RegisterDB(db ethdb.KeyValueStore)
RegisterDB registers the db.
func (*AppBuilder) RegisterEthClient ¶
func (ab *AppBuilder) RegisterEthClient(ethClient eth.Client)
RegisterEthClient registers the eth client. TODO: update this to connection pool on baseapp and context gets one for running
func (*AppBuilder) RegisterHTTPHandler ¶
func (ab *AppBuilder) RegisterHTTPHandler(handler *server.Handler) error
RegisterHTTPHandler registers a HTTP handler.
func (*AppBuilder) RegisterHTTPServer ¶
func (ab *AppBuilder) RegisterHTTPServer(svr *server.Server)
RegisterHTTPServer registers the http server.
func (*AppBuilder) RegisterJob ¶
func (ab *AppBuilder) RegisterJob(job job.Basic)
AppName sets the name of the app.
func (*AppBuilder) RegisterMetrics ¶
func (ab *AppBuilder) RegisterMetrics(cfg *telemetry.Config) error
RegisterMetrics registers the metrics.
func (*AppBuilder) RegisterMiddleware ¶
func (ab *AppBuilder) RegisterMiddleware(m server.Middleware) error
RegisterMiddleware registers a middleware to the HTTP server.
type BaseApp ¶
type BaseApp struct {
// contains filtered or unexported fields
}
BaseApp is the base application.
func New ¶
func New( name string, logger log.Logger, ethClient eth.Client, jobs []job.Basic, db ethdb.KeyValueStore, svr *server.Server, metrics telemetry.Metrics, ) *BaseApp
New creates a new baseapp.
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager handles the job and worker lifecycle.
func NewManager ¶
func NewManager( jobs []job.Basic, ctxFactory *contextFactory, ) *JobManager
NewManager creates a new manager.
func (*JobManager) Logger ¶
func (jm *JobManager) Logger(ctx context.Context) log.Logger
Logger returns the logger for the baseapp.
func (*JobManager) RunProducers ¶
func (jm *JobManager) RunProducers(gctx context.Context)
RunProducers sets up each job and runs its producer.
func (*JobManager) Start ¶
func (jm *JobManager) Start(ctx context.Context)
Start calls `Setup` on the jobs in the registry as well as spins up the worker pools.
func (*JobManager) Stop ¶
func (jm *JobManager) Stop()
Stop calls `Teardown` on the jobs in the registry as well as shut's down all the worker pools.