chainlink: Index | Files

package synchronization

import ""


Package Files

presenters.go stats_pusher.go web_socket_client.go


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 Uses

type ConnectionStatus string

type StatsPusher Uses

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 Uses

func NewStatsPusher(orm *orm.ORM, url *url.URL, accessKey, secret string, afters ...utils.Afterer) StatsPusher

NewStatsPusher returns a new event queuer

type SyncJobRunPresenter Uses

type SyncJobRunPresenter struct {

SyncJobRunPresenter presents a JobRun for synchronization purposes

func (SyncJobRunPresenter) MarshalJSON Uses

func (p SyncJobRunPresenter) MarshalJSON() ([]byte, error)

MarshalJSON returns the JobRun as JSON

type TxStatus Uses

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 Uses

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 Uses

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

NewWebSocketClient returns a stats pusher using a websocket for delivery.

Package synchronization imports 23 packages (graph). Updated 2020-04-08. Refresh now. Tools for package owners.

The go get command cannot install this package because of the following issues: