Documentation ¶
Index ¶
- type Application
- type ChainlinkApplication
- func (app *ChainlinkApplication) AddJob(job models.JobSpec) error
- func (app *ChainlinkApplication) AddJobV2(ctx context.Context, j job.Job, name null.String) (int32, error)
- func (app *ChainlinkApplication) AddServiceAgreement(sa *models.ServiceAgreement) error
- func (app *ChainlinkApplication) ArchiveJob(ID models.JobID) error
- func (app *ChainlinkApplication) DeleteJobV2(ctx context.Context, jobID int32) error
- func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
- func (app *ChainlinkApplication) GetFeedsService() feeds.Service
- func (app *ChainlinkApplication) GetHeadBroadcaster() httypes.HeadBroadcasterRegistry
- func (app *ChainlinkApplication) GetHealthChecker() health.Checker
- func (app *ChainlinkApplication) GetKeyStore() *keystore.Master
- func (app *ChainlinkApplication) GetLogger() *logger.Logger
- func (app *ChainlinkApplication) GetStatsPusher() synchronization.StatsPusher
- func (app *ChainlinkApplication) GetStore() *strpkg.Store
- func (app *ChainlinkApplication) JobORM() job.ORM
- func (app *ChainlinkApplication) JobSpawner() job.Spawner
- func (app *ChainlinkApplication) NewBox() packr.Box
- func (app *ChainlinkApplication) PipelineORM() pipeline.ORM
- func (app *ChainlinkApplication) RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error)
- func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, ...) (int64, error)
- func (app *ChainlinkApplication) SetServiceLogger(ctx context.Context, serviceName string, level zapcore.Level) error
- func (app *ChainlinkApplication) Start() error
- func (app *ChainlinkApplication) Stop() error
- func (app *ChainlinkApplication) StopIfStarted() error
- func (app *ChainlinkApplication) WakeSessionReaper()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { Start() error Stop() error GetLogger() *logger.Logger GetHealthChecker() health.Checker GetStore() *strpkg.Store GetKeyStore() *keystore.Master GetStatsPusher() synchronization.StatsPusher GetHeadBroadcaster() httypes.HeadBroadcasterRegistry WakeSessionReaper() AddServiceAgreement(*models.ServiceAgreement) error NewBox() packr.Box // V1 Jobs (JSON specified) services.RunManager // For managing job runs. AddJob(job models.JobSpec) error ArchiveJob(models.JobID) error GetExternalInitiatorManager() webhook.ExternalInitiatorManager // V2 Jobs (TOML specified) JobSpawner() job.Spawner JobORM() job.ORM PipelineORM() pipeline.ORM AddJobV2(ctx context.Context, job job.Job, name null.String) (int32, error) DeleteJobV2(ctx context.Context, jobID int32) error RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error) // Testing only RunJobV2(ctx context.Context, jobID int32, meta map[string]interface{}) (int64, error) SetServiceLogger(ctx context.Context, service string, level zapcore.Level) error // Feeds GetFeedsService() feeds.Service }
Application implements the common functions used in the core node.
func NewApplication ¶
func NewApplication(config *orm.Config, ethClient eth.Client, advisoryLocker postgres.AdvisoryLocker, onConnectCallbacks ...func(Application)) (Application, error)
NewApplication initializes a new store if one is not already present at the configured root directory (default: ~/.chainlink), the logger at the same directory and returns the Application to be used by the node.
type ChainlinkApplication ¶
type ChainlinkApplication struct { Exiter func(int) HeadTracker httypes.Tracker HeadBroadcaster httypes.HeadBroadcaster TxManager bulletprooftxmanager.TxManager StatsPusher synchronization.StatsPusher services.RunManager RunQueue services.RunQueue JobSubscriber services.JobSubscriber LogBroadcaster log.Broadcaster EventBroadcaster postgres.EventBroadcaster FluxMonitor fluxmonitor.Service FeedsService feeds.Service Scheduler *services.Scheduler Store *strpkg.Store KeyStore *keystore.Master ExternalInitiatorManager webhook.ExternalInitiatorManager SessionReaper utils.SleeperTask HealthChecker health.Checker // contains filtered or unexported fields }
ChainlinkApplication contains fields for the JobSubscriber, Scheduler, and Store. The JobSubscriber and Scheduler are also available in the services package, but the Store has its own package.
func (*ChainlinkApplication) AddJob ¶
func (app *ChainlinkApplication) AddJob(job models.JobSpec) error
AddJob adds a job to the store and the scheduler. If there was an error from adding the job to the store, the job will not be added to the scheduler.
func (*ChainlinkApplication) AddServiceAgreement ¶
func (app *ChainlinkApplication) AddServiceAgreement(sa *models.ServiceAgreement) error
AddServiceAgreement adds a Service Agreement which includes a job that needs to be scheduled.
func (*ChainlinkApplication) ArchiveJob ¶
func (app *ChainlinkApplication) ArchiveJob(ID models.JobID) error
ArchiveJob silences the job from the system, preventing future job runs. It is idempotent and can be run as many times as you like.
func (*ChainlinkApplication) DeleteJobV2 ¶
func (app *ChainlinkApplication) DeleteJobV2(ctx context.Context, jobID int32) error
func (*ChainlinkApplication) GetExternalInitiatorManager ¶
func (app *ChainlinkApplication) GetExternalInitiatorManager() webhook.ExternalInitiatorManager
func (*ChainlinkApplication) GetFeedsService ¶
func (app *ChainlinkApplication) GetFeedsService() feeds.Service
func (*ChainlinkApplication) GetHeadBroadcaster ¶
func (app *ChainlinkApplication) GetHeadBroadcaster() httypes.HeadBroadcasterRegistry
func (*ChainlinkApplication) GetHealthChecker ¶
func (app *ChainlinkApplication) GetHealthChecker() health.Checker
func (*ChainlinkApplication) GetKeyStore ¶
func (app *ChainlinkApplication) GetKeyStore() *keystore.Master
func (*ChainlinkApplication) GetLogger ¶
func (app *ChainlinkApplication) GetLogger() *logger.Logger
func (*ChainlinkApplication) GetStatsPusher ¶
func (app *ChainlinkApplication) GetStatsPusher() synchronization.StatsPusher
func (*ChainlinkApplication) GetStore ¶
func (app *ChainlinkApplication) GetStore() *strpkg.Store
GetStore returns the pointer to the store for the ChainlinkApplication.
func (*ChainlinkApplication) JobORM ¶
func (app *ChainlinkApplication) JobORM() job.ORM
func (*ChainlinkApplication) JobSpawner ¶
func (app *ChainlinkApplication) JobSpawner() job.Spawner
func (*ChainlinkApplication) NewBox ¶
func (app *ChainlinkApplication) NewBox() packr.Box
NewBox returns the packr.Box instance that holds the static assets to be delivered by the router.
func (*ChainlinkApplication) PipelineORM ¶
func (app *ChainlinkApplication) PipelineORM() pipeline.ORM
func (*ChainlinkApplication) RunJobV2 ¶
func (app *ChainlinkApplication) RunJobV2( ctx context.Context, jobID int32, meta map[string]interface{}, ) (int64, error)
Only used for testing, not supported by the UI.
func (*ChainlinkApplication) RunWebhookJobV2 ¶
func (app *ChainlinkApplication) RunWebhookJobV2(ctx context.Context, jobUUID uuid.UUID, requestBody string, meta pipeline.JSONSerializable) (int64, error)
func (*ChainlinkApplication) SetServiceLogger ¶
func (app *ChainlinkApplication) SetServiceLogger(ctx context.Context, serviceName string, level zapcore.Level) error
SetServiceLogger sets the Logger for a given service and stores the setting in the db
func (*ChainlinkApplication) Start ¶
func (app *ChainlinkApplication) Start() error
Start all necessary services. If successful, nil will be returned. Also listens for interrupt signals from the operating system so that the application can be properly closed before the application exits.
func (*ChainlinkApplication) Stop ¶
func (app *ChainlinkApplication) Stop() error
Stop allows the application to exit by halting schedules, closing logs, and closing the DB connection.
func (*ChainlinkApplication) StopIfStarted ¶
func (app *ChainlinkApplication) StopIfStarted() error
func (*ChainlinkApplication) WakeSessionReaper ¶
func (app *ChainlinkApplication) WakeSessionReaper()
WakeSessionReaper wakes up the reaper to do its reaping.