destination

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkerStateOnline int64 = 1

Functions

This section is empty.

Types

type NVCKey

type NVCKey struct {
	Network string
	Version string
	ChainID string
}

func (NVCKey) String

func (nv NVCKey) String() string

type Scheme

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

func NewScheme

func NewScheme(logger *zap.Logger) *Scheme

func (*Scheme) Add

func (s *Scheme) Add(t Target)

func (*Scheme) AddManager

func (s *Scheme) AddManager(address string)

func (*Scheme) Get

func (s *Scheme) Get(nv NVCKey) (Target, bool)

func (*Scheme) Refresh

func (s *Scheme) Refresh(ctx context.Context) error

func (*Scheme) RegisterHandles

func (s *Scheme) RegisterHandles(smux *http.ServeMux)

type Target

type Target struct {
	ChainID string
	Network string
	Version string
	Address string
}

type WorkerConnection

type WorkerConnection struct {
	Version string `json:"version"`
	ChainID string `json:"chain_id"`
	Type    string `json:"type"`
}

type WorkerInfoStatic

type WorkerInfoStatic struct {
	NodeSelfID     string             `json:"node_id"`
	Type           string             `json:"type"`
	State          int64              `json:"state"`
	ConnectionInfo []WorkerConnection `json:"connection"`
	LastCheck      time.Time          `json:"last_check"`
}

type WorkerNetworkStatic

type WorkerNetworkStatic struct {
	Workers map[string]WorkerInfoStatic `json:"workers"`
	All     int                         `json:"all"`
	Active  int                         `json:"active"`
}

Jump to

Keyboard shortcuts

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