bootstrap

package
v0.0.0-...-1c0411e Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SEND flags.FlagType = 0b1
	ERR  flags.FlagType = 0b10
	GET  flags.FlagType = 0b100
)

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(c Config) bool

Types

type Bootstrap

type Bootstrap struct {
	Config  Config // no need for mutex since its readonly
	Address string
}

func New

func New(filename, address string) *Bootstrap

func (*Bootstrap) GetNode

func (b *Bootstrap) GetNode(addrPort string) (Node, error)

func (*Bootstrap) Listen

func (b *Bootstrap) Listen()

type Config

type Config struct {
	NodeGroup Nodes `json:"nodes"`
}

type Node

type Node struct {
	Type       NodeType         `json:"type"`
	SelfIp     string           `json:"self"`
	Neighbours []netip.AddrPort `json:"neighbours"`
}

type NodeType

type NodeType string
const (
	Client          NodeType = "client"
	Server          NodeType = "server"
	RendezvousPoint NodeType = "rendezvous"
	ONode           NodeType = "node"
)

type Nodes

type Nodes map[string]Node

type Packet

type Packet = packets.BasePacket[Node]

Jump to

Keyboard shortcuts

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