Documentation ¶
Index ¶
- Constants
- Variables
- func NewTelemetryIngressBatchWorker(telemMaxBatchSize uint, telemSendInterval time.Duration, ...) *telemetryIngressBatchWorker
- 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(context.Context) error
- func (NoopExplorerClient) Status() ConnectionStatus
- func (NoopExplorerClient) Url() url.URL
- type NoopTelemetryIngressBatchClient
- type NoopTelemetryIngressClient
- type TelemPayload
- type TelemetryIngressBatchClient
- type TelemetryIngressClient
Constants ¶
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") )
const ( ExplorerTextMessage = websocket.TextMessage ExplorerBinaryMessage = websocket.BinaryMessage )
const CloseTimeout = 100 * time.Millisecond
const SendBufferSize = 100
SendBufferSize is the number of messages to keep in the buffer before dropping additional ones
const SendIngressBufferSize = 100
SendIngressBufferSize is the number of messages to keep in the buffer before dropping additional ones
Variables ¶
var ( // ErrReceiveTimeout is returned when no message is received after a // specified duration in Receive ErrReceiveTimeout = errors.New("timeout waiting for message") )
Functions ¶
func NewTelemetryIngressBatchWorker ¶ added in v1.2.0
func NewTelemetryIngressBatchWorker( telemMaxBatchSize uint, telemSendInterval time.Duration, telemSendTimeout time.Duration, telemClient telemPb.TelemClient, wgDone *sync.WaitGroup, chDone chan struct{}, chTelemetry chan TelemPayload, contractID string, globalLogger logger.Logger, logging bool, ) *telemetryIngressBatchWorker
NewTelemetryIngressBatchWorker returns a worker for a given contractID that can send telemetry to the ingress server via WSRPC
Types ¶
type ConnectionStatus ¶ added in v0.8.2
type ConnectionStatus string
type ExplorerClient ¶ added in v0.9.3
type ExplorerClient interface { services.ServiceCtx 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
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
Close is a no-op
func (NoopExplorerClient) Healthy ¶ added in v0.10.8
func (NoopExplorerClient) Healthy() error
Healthy is a no-op
func (NoopExplorerClient) Ready ¶ added in v0.10.8
func (NoopExplorerClient) Ready() error
Ready is a no-op
func (NoopExplorerClient) Send ¶ added in v0.9.3
func (NoopExplorerClient) Send(context.Context, []byte, ...int)
Send is a no-op
func (NoopExplorerClient) Start ¶ added in v0.9.3
func (NoopExplorerClient) Start(context.Context) error
Start is a no-op
func (NoopExplorerClient) Status ¶ added in v0.9.3
func (NoopExplorerClient) Status() ConnectionStatus
Status always returns ConnectionStatusDisconnected.
func (NoopExplorerClient) Url ¶ added in v0.9.3
func (NoopExplorerClient) Url() url.URL
Url always returns underlying url.
type NoopTelemetryIngressBatchClient ¶ added in v1.2.0
type NoopTelemetryIngressBatchClient struct{}
NoopTelemetryIngressBatchClient is a no-op interface for TelemetryIngressBatchClient
func (NoopTelemetryIngressBatchClient) Close ¶ added in v1.2.0
func (NoopTelemetryIngressBatchClient) Close() error
Close is a no-op
func (NoopTelemetryIngressBatchClient) Healthy ¶ added in v1.2.0
func (NoopTelemetryIngressBatchClient) Healthy() error
Healthy is a no-op
func (NoopTelemetryIngressBatchClient) Ready ¶ added in v1.2.0
func (NoopTelemetryIngressBatchClient) Ready() error
Ready is a no-op
func (NoopTelemetryIngressBatchClient) Send ¶ added in v1.2.0
func (NoopTelemetryIngressBatchClient) Send(TelemPayload)
Send is a no-op
type NoopTelemetryIngressClient ¶ added in v1.0.0
type NoopTelemetryIngressClient struct{}
func (NoopTelemetryIngressClient) Close ¶ added in v1.0.0
func (NoopTelemetryIngressClient) Close() error
Close is a no-op
func (NoopTelemetryIngressClient) Healthy ¶ added in v1.0.0
func (NoopTelemetryIngressClient) Healthy() error
Healthy is a no-op
func (NoopTelemetryIngressClient) Ready ¶ added in v1.0.0
func (NoopTelemetryIngressClient) Ready() error
Ready is a no-op
func (NoopTelemetryIngressClient) Send ¶ added in v1.0.0
func (NoopTelemetryIngressClient) Send(TelemPayload)
Send is a no-op
type TelemPayload ¶ added in v1.0.0
type TelemetryIngressBatchClient ¶ added in v1.2.0
type TelemetryIngressBatchClient interface { services.ServiceCtx Send(TelemPayload) }
TelemetryIngressBatchClient encapsulates all the functionality needed to send telemetry to the ingress server using wsrpc
func NewTelemetryIngressBatchClient ¶ added in v1.2.0
func NewTelemetryIngressBatchClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint, telemMaxBatchSize uint, telemSendInterval time.Duration, telemSendTimeout time.Duration, useUniconn bool) TelemetryIngressBatchClient
NewTelemetryIngressBatchClient returns a client backed by wsrpc that can send telemetry to the telemetry ingress server
type TelemetryIngressClient ¶ added in v1.0.0
type TelemetryIngressClient interface { services.ServiceCtx Send(TelemPayload) }
TelemetryIngressClient encapsulates all the functionality needed to send telemetry to the ingress server using wsrpc
func NewTelemetryIngressClient ¶ added in v1.0.0
func NewTelemetryIngressClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger) TelemetryIngressClient
NewTelemetryIngressClient returns a client backed by wsrpc that can send telemetry to the telemetry ingress server