connector

package
v2.2.0-mercury-20230527 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectorConfig

type ConnectorConfig struct {
	NodeAddress              string
	DonId                    string
	Gateways                 []ConnectorGatewayConfig
	WsClientConfig           network.WebSocketClientConfig
	MinHandshakeChallengeLen int
}

type ConnectorGatewayConfig

type ConnectorGatewayConfig struct {
	Id  string
	URL string
}

type GatewayConnector

type GatewayConnector interface {
	job.ServiceCtx
	network.ConnectionInitiator

	SendToGateway(ctx context.Context, gatewayId string, msg *gateway.Message) error
}

GatewayConnector is a component run by Nodes to connect to a set of Gateways.

func NewGatewayConnector

func NewGatewayConnector(config *ConnectorConfig, signer Signer, handler GatewayConnectorHandler, clock common.Clock, lggr logger.Logger) (GatewayConnector, error)

type GatewayConnectorHandler

type GatewayConnectorHandler interface {
	HandleGatewayMessage(gatewayId string, msg *gateway.Message)
}

type Signer

type Signer interface {
	// Sign keccak256 hash of data.
	Sign(data ...[]byte) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL