Back to

package synchronization

Latest Go to latest
Published: 4 days ago | License: MIT | Module:



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")


var (
	// ErrReceiveTimeout is returned when no message is received after a
	// specified duration in Receive
	ErrReceiveTimeout = errors.New("timeout waiting for message")

type ConnectionStatus

type ConnectionStatus string

type StatsPusher

type StatsPusher interface {
	Start() error
	Close() error
	GetURL() url.URL
	GetStatus() ConnectionStatus

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(orm *orm.ORM, url *url.URL, accessKey, secret string, afters ...utils.Afterer) StatsPusher

NewStatsPusher returns a new event queuer

type SyncJobRunPresenter

type SyncJobRunPresenter struct {

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"

type WebSocketClient

type WebSocketClient interface {
	Url() url.URL
	Status() ConnectionStatus
	Start() error
	Close() error
	Receive(...time.Duration) ([]byte, error)

WebSocketClient encapsulates all the functionality needed to push run information to explorer.

func NewWebSocketClient

func NewWebSocketClient(url *url.URL, accessKey, secret string) WebSocketClient

NewWebSocketClient returns a stats pusher using a websocket for delivery.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier