connector

package
v2.2.0-mercury-20230616-2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 12 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 *api.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 utils.Clock, lggr logger.Logger) (GatewayConnector, error)

type GatewayConnectorHandler

type GatewayConnectorHandler interface {
	job.ServiceCtx

	HandleGatewayMessage(gatewayId string, msg *api.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