p2p

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type Type `yaml:"type"`

	Config *RawMessage `yaml:"config"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDialedNodeRecod

func (m *Metrics) AddDialedNodeRecod(count int, result string)

func (*Metrics) SetActiveDialingNodeRecods

func (m *Metrics) SetActiveDialingNodeRecods(count int, layer string)

type P2P

type P2P interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Type() string
}

func NewP2P

func NewP2P(p2pType Type, config *RawMessage, handler func(ctx context.Context, node *enode.Node, source string) error, log logrus.FieldLogger) (P2P, error)

type Peer

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

func NewPeer

func NewPeer(ctx context.Context, log logrus.FieldLogger, nodeRecord string, handlerFunc func(ctx context.Context, status *xatu.ExecutionNodeStatus)) (*Peer, error)

func (*Peer) Start

func (p *Peer) Start(ctx context.Context) (<-chan error, error)

func (*Peer) Stop

func (p *Peer) Stop(ctx context.Context) error

type RawMessage

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

func (*RawMessage) Unmarshal

func (r *RawMessage) Unmarshal(v interface{}) error

func (*RawMessage) UnmarshalYAML

func (r *RawMessage) UnmarshalYAML(unmarshal func(interface{}) error) error

type Status

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

func NewStatus

func NewStatus(ctx context.Context, config *Config, log logrus.FieldLogger) *Status

func (*Status) ActiveExecution

func (s *Status) ActiveExecution() int

func (*Status) AddExecutionNodeRecords

func (s *Status) AddExecutionNodeRecords(ctx context.Context, nodeRecords []string)

func (*Status) OnExecutionStatus

func (s *Status) OnExecutionStatus(ctx context.Context, handler func(ctx context.Context, status *xatu.ExecutionNodeStatus) error)

func (*Status) Start

func (s *Status) Start(ctx context.Context) error

func (*Status) Stop

func (s *Status) Stop(ctx context.Context) error

type Type

type Type string
const (
	TypeUnknown Type = "unknown"
	TypeStatic  Type = static.Type
	TypeXatu    Type = xatu.Type
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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