{"modulePath":"github.com/GoPlugin/pluginV2","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package synchronization\n\n## Constants\n\n```go\nconst (\n\t// ConnectionStatusDisconnected is the default state\n\tConnectionStatusDisconnected = ConnectionStatus(\"disconnected\")\n\t// ConnectionStatusConnected is used when the client is successfully connected\n\tConnectionStatusConnected = ConnectionStatus(\"connected\")\n\t// ConnectionStatusError is used when there is an error\n\tConnectionStatusError = ConnectionStatus(\"error\")\n)\n```\n\n```go\nconst (\n\tExplorerTextMessage   = websocket.TextMessage\n\tExplorerBinaryMessage = websocket.BinaryMessage\n)\n```\n\n```go\nconst SendBufferSize = 100\n```\nSendBufferSize is the number of messages to keep in the buffer before dropping additional ones\n\n## Variables\n\n```go\nvar (\n\t// ErrReceiveTimeout is returned when no message is received after a\n\t// specified duration in Receive\n\tErrReceiveTimeout = errors.New(\"timeout waiting for message\")\n)\n```\n\n## Functions\n\n```go\nfunc NewTelemetryIngressBatchWorker(\n\ttelemMaxBatchSize uint,\n\ttelemSendInterval time.Duration,\n\ttelemSendTimeout time.Duration,\n\ttelemClient telemPb.TelemClient,\n\twgDone *sync.WaitGroup,\n\tchDone chan struct{},\n\tchTelemetry chan TelemPayload,\n\tcontractID string,\n\ttelemType TelemetryType,\n\tglobalLogger logger.Logger,\n\tlogging bool,\n) *telemetryIngressBatchWorker\n```\nNewTelemetryIngressBatchWorker returns a worker for a given contractID that can send telemetry to the ingress server via WSRPC\n\n## Types\n\n```go\ntype ConnectionStatus string\n```\n\n```go\ntype ExplorerClient interface {\n\tservices.ServiceCtx\n\tUrl() url.URL\n\tStatus() ConnectionStatus\n\tSend(context.Context, []byte, ...int)\n\tReceive(context.Context, ...time.Duration) ([]byte, error)\n}\n```\nExplorerClient encapsulates all the functionality needed to push run information to explorer.\n\n```go\nfunc NewExplorerClient(url *url.URL, accessKey, secret string, lggr logger.Logger) ExplorerClient\n```\nNewExplorerClient returns a stats pusher using a websocket for delivery.\n\n```go\ntype NoopExplorerClient struct{}\n```\n\n```go\nfunc (NoopExplorerClient) Close() error\n```\nClose is a no-op\n\n```go\nfunc (NoopExplorerClient) HealthReport() map[string]error\n```\n\n```go\nfunc (NoopExplorerClient) Healthy() error\n```\nHealthy is a no-op\n\n```go\nfunc (NoopExplorerClient) Name() string\n```\n\n```go\nfunc (NoopExplorerClient) Ready() error\n```\nReady is a no-op\n\n```go\nfunc (NoopExplorerClient) Receive(context.Context, ...time.Duration) ([]byte, error)\n```\nReceive is a no-op\n\n```go\nfunc (NoopExplorerClient) Send(context.Context, []byte, ...int)\n```\nSend is a no-op\n\n```go\nfunc (NoopExplorerClient) Start(context.Context) error\n```\nStart is a no-op\n\n```go\nfunc (NoopExplorerClient) Status() ConnectionStatus\n```\nStatus always returns ConnectionStatusDisconnected.\n\n```go\nfunc (NoopExplorerClient) Url() url.URL\n```\nUrl always returns underlying url.\n\n```go\ntype NoopTelemetryIngressBatchClient struct{}\n```\nNoopTelemetryIngressBatchClient is a no-op interface for TelemetryIngressBatchClient\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Close() error\n```\nClose is a no-op\n\n```go\nfunc (NoopTelemetryIngressBatchClient) HealthReport() map[string]error\n```\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Healthy() error\n```\nHealthy is a no-op\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Name() string\n```\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Ready() error\n```\nReady is a no-op\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Send(TelemPayload)\n```\nSend is a no-op\n\n```go\nfunc (NoopTelemetryIngressBatchClient) Start(context.Context) error\n```\nStart is a no-op\n\n```go\ntype NoopTelemetryIngressClient struct{}\n```\n\n```go\nfunc (NoopTelemetryIngressClient) Close() error\n```\nClose is a no-op\n\n```go\nfunc (NoopTelemetryIngressClient) HealthReport() map[string]error\n```\n\n```go\nfunc (NoopTelemetryIngressClient) Healthy() error\n```\nHealthy is a no-op\n\n```go\nfunc (NoopTelemetryIngressClient) Name() string\n```\n\n```go\nfunc (NoopTelemetryIngressClient) Ready() error\n```\nReady is a no-op\n\n```go\nfunc (NoopTelemetryIngressClient) Send(TelemPayload)\n```\nSend is a no-op\n\n```go\nfunc (NoopTelemetryIngressClient) Start(context.Context) error\n```\nStart is a no-op\n\n```go\ntype TelemPayload struct {\n\tCtx        context.Context\n\tTelemetry  []byte\n\tTelemType  TelemetryType\n\tContractID string\n}\n```\n\n```go\ntype TelemetryIngressBatchClient interface {\n\tservices.ServiceCtx\n\tSend(TelemPayload)\n}\n```\nTelemetryIngressBatchClient encapsulates all the functionality needed to send telemetry to the ingress server using wsrpc\n\n```go\nfunc 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\n```\nNewTelemetryIngressBatchClient returns a client backed by wsrpc that can send telemetry to the telemetry ingress server\n\n```go\ntype TelemetryIngressClient interface {\n\tservices.ServiceCtx\n\tSend(TelemPayload)\n}\n```\nTelemetryIngressClient encapsulates all the functionality needed to send telemetry to the ingress server using wsrpc\n\n```go\nfunc NewTelemetryIngressClient(url *url.URL, serverPubKeyHex string, ks keystore.CSA, logging bool, lggr logger.Logger, telemBufferSize uint) TelemetryIngressClient\n```\nNewTelemetryIngressClient returns a client backed by wsrpc that can send telemetry to the telemetry ingress server\n\n```go\ntype TelemetryType string\n```\nTelemetryType defines supported telemetry types\n\n```go\nconst (\n\tOCR            TelemetryType = \"ocr\"\n\tOCR2Median     TelemetryType = \"ocr2-median\"\n\tOCR2VRF        TelemetryType = \"ocr2-vrf\"\n\tOCR2Automation TelemetryType = \"ocr2-automation\"\n\tOCR2Functions  TelemetryType = \"ocr2-functions\"\n)\n```\n\n","path":"github.com/GoPlugin/pluginV2/core/services/synchronization","name":"synchronization","synopsis":"","isRedistributable":true}
