Documentation ¶
Index ¶
- Constants
- Variables
- func InsertSyncEventForJobRun(db *gorm.DB, run *models.JobRun) error
- type ConnectionStatus
- type ExplorerClient
- type NoopExplorerClient
- func (NoopExplorerClient) Close() error
- func (NoopExplorerClient) Healthy() error
- func (NoopExplorerClient) Ready() error
- func (NoopExplorerClient) Receive(context.Context, ...time.Duration) ([]byte, error)
- func (NoopExplorerClient) Send(context.Context, []byte, ...int)
- func (NoopExplorerClient) Start() error
- func (NoopExplorerClient) Status() ConnectionStatus
- func (NoopExplorerClient) Url() url.URL
- type NoopStatsPusher
- func (NoopStatsPusher) AllSyncEvents(cb func(models.SyncEvent) error) error
- func (NoopStatsPusher) Close() error
- func (NoopStatsPusher) GetStatus() ConnectionStatus
- func (NoopStatsPusher) GetURL() url.URL
- func (NoopStatsPusher) Healthy() error
- func (NoopStatsPusher) PushNow()
- func (NoopStatsPusher) Ready() error
- func (NoopStatsPusher) Start() error
- type StatsPusher
- type SyncJobRunPresenter
- type TxStatus
Constants ¶
View Source
const ( // ConnectionStatusDisconnected is the default state ConnectionStatusDisconnected = ConnectionStatus("disconnected") // ConnectionStatusConnected is used when the client is successfully connected ConnectionStatusConnected = ConnectionStatus("connected") // ConnectionStatusError is used when there is an error ConnectionStatusError = ConnectionStatus("error") )
View Source
const ( ExplorerTextMessage = websocket.TextMessage ExplorerBinaryMessage = websocket.BinaryMessage )
View Source
const CloseTimeout = 100 * time.Millisecond
View Source
const SendBufferSize = 100
SendBufferSize is the number of messages to keep in the buffer before dropping additional ones
Variables ¶
View Source
var ( // ErrReceiveTimeout is returned when no message is received after a // specified duration in Receive ErrReceiveTimeout = errors.New("timeout waiting for message") )
Functions ¶
Types ¶
type ConnectionStatus ¶ added in v0.8.2
type ConnectionStatus string
type ExplorerClient ¶ added in v0.9.3
type ExplorerClient interface { service.Service Url() url.URL Status() ConnectionStatus Send(context.Context, []byte, ...int) Receive(context.Context, ...time.Duration) ([]byte, error) }
ExplorerClient encapsulates all the functionality needed to push run information to explorer.
func NewExplorerClient ¶ added in v0.9.3
func NewExplorerClient(url *url.URL, accessKey, secret string, loggingArgs ...bool) ExplorerClient
NewExplorerClient returns a stats pusher using a websocket for delivery.
type NoopExplorerClient ¶ added in v0.9.3
type NoopExplorerClient struct{}
func (NoopExplorerClient) Close ¶ added in v0.9.3
func (NoopExplorerClient) Close() error
func (NoopExplorerClient) Healthy ¶ added in v0.10.8
func (NoopExplorerClient) Healthy() error
func (NoopExplorerClient) Ready ¶ added in v0.10.8
func (NoopExplorerClient) Ready() error
func (NoopExplorerClient) Send ¶ added in v0.9.3
func (NoopExplorerClient) Send(context.Context, []byte, ...int)
func (NoopExplorerClient) Start ¶ added in v0.9.3
func (NoopExplorerClient) Start() error
func (NoopExplorerClient) Status ¶ added in v0.9.3
func (NoopExplorerClient) Status() ConnectionStatus
func (NoopExplorerClient) Url ¶ added in v0.9.3
func (NoopExplorerClient) Url() url.URL
type NoopStatsPusher ¶ added in v0.9.3
type NoopStatsPusher struct{}
func (NoopStatsPusher) AllSyncEvents ¶ added in v0.9.7
func (NoopStatsPusher) AllSyncEvents(cb func(models.SyncEvent) error) error
func (NoopStatsPusher) Close ¶ added in v0.9.3
func (NoopStatsPusher) Close() error
func (NoopStatsPusher) GetStatus ¶ added in v0.9.3
func (NoopStatsPusher) GetStatus() ConnectionStatus
func (NoopStatsPusher) GetURL ¶ added in v0.9.3
func (NoopStatsPusher) GetURL() url.URL
func (NoopStatsPusher) Healthy ¶ added in v0.10.8
func (NoopStatsPusher) Healthy() error
func (NoopStatsPusher) PushNow ¶ added in v0.9.3
func (NoopStatsPusher) PushNow()
func (NoopStatsPusher) Ready ¶ added in v0.10.8
func (NoopStatsPusher) Ready() error
func (NoopStatsPusher) Start ¶ added in v0.9.3
func (NoopStatsPusher) Start() error
type StatsPusher ¶
type StatsPusher interface { service.Service PushNow() GetURL() url.URL GetStatus() ConnectionStatus AllSyncEvents(cb func(models.SyncEvent) error) error }
StatsPusher polls for events and pushes them via a WebSocketClient. Events are consumed by the Explorer. Currently there is only one event type: an encoding of a JobRun.
func NewStatsPusher ¶
func NewStatsPusher(db *gorm.DB, explorerClient ExplorerClient, afters ...utils.Afterer) StatsPusher
NewStatsPusher returns a new StatsPusher service
type SyncJobRunPresenter ¶
SyncJobRunPresenter presents a JobRun for synchronization purposes
func (SyncJobRunPresenter) MarshalJSON ¶
func (p SyncJobRunPresenter) MarshalJSON() ([]byte, error)
MarshalJSON returns the JobRun as JSON
type TxStatus ¶
type TxStatus string
TxStatus indicates if a transaction is fulfilled or not
const ( // StatusFulfilledRunLog indicates that a ChainlinkFulfilled event was // detected in the transaction receipt. StatusFulfilledRunLog TxStatus = "fulfilledRunLog" // StatusNoFulfilledRunLog indicates that no ChainlinkFulfilled events were // detected in the transaction receipt. StatusNoFulfilledRunLog = "noFulfilledRunLog" )
Click to show internal directories.
Click to hide internal directories.