network

package
v0.0.0-...-bce1b98 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network interface {
	Start()
}

type NetworkMediator

type NetworkMediator interface {
	MessageHandler(message string, source Source)
}

type NetworkModule

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

func NewNetwork

func NewNetwork(ctx context.Context, execution execution.Execution, storage storage.Storage, config *config.NetworkConfig) *NetworkModule

func (*NetworkModule) MessageHandler

func (network *NetworkModule) MessageHandler(message string, source Source)

func (*NetworkModule) Start

func (network *NetworkModule) Start()

type P2P

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

func NewP2P

func NewP2P(ctx context.Context, mediator NetworkMediator, namespace string, maxPeers int) *P2P

func (*P2P) JoinNetwork

func (p2p *P2P) JoinNetwork()

func (*P2P) Publish

func (p2p *P2P) Publish(message string)

func (*P2P) SubscribeTopics

func (p2p *P2P) SubscribeTopics(topics []string)

type RPC

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

func NewRPC

func NewRPC(ctx context.Context, mediator NetworkMediator) *RPC

func (*RPC) Start

func (rpc *RPC) Start()

type Source

type Source int
const (
	SourceP2P Source = iota
	SourceRPC
)

Jump to

Keyboard shortcuts

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