connectivity

package
v0.9.28 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Observer metrics.Observer
	StatusOK metrics.Counter
	Address  string
}

type WorkerConnections

type WorkerConnections struct {
	// contains filtered or unexported fields
}

WorkerConnections is connection controller for worker

func NewWorkerConnections

func NewWorkerConnections(id, address, network, chainID, version string) *WorkerConnections

NewWorkerConnections is WorkerConnections constructor

func (*WorkerConnections) AddManager

func (wc *WorkerConnections) AddManager(managerAddress string)

AddManager dynamically adds manager to the list

func (*WorkerConnections) RemoveManager

func (wc *WorkerConnections) RemoveManager(managerAddress string)

RemoveManager dynamically removes manager to the list

func (*WorkerConnections) Run

func (wc *WorkerConnections) Run(ctx context.Context, logger *zap.Logger, dur time.Duration)

Run controls the registration of worker in manager. Every tick it sends it's identity (with address and network type) to every configured address.

type WorkerInfoConnectivity

type WorkerInfoConnectivity struct {
	Version string `json:"version"`
	Type    string `json:"type"`
	Address string `json:"address"`
}

type WorkerResponse

type WorkerResponse struct {
	ID           string                 `json:"id"`
	Network      string                 `json:"network"`
	ChainID      string                 `json:"chain_id"`
	Connectivity WorkerInfoConnectivity `json:"connectivity"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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