system

package
v0.0.0-...-7b304d6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoKey = fmt.Errorf("key not found")
)

Functions

This section is empty.

Types

type ConsensusInterface

type ConsensusInterface interface {
	Leader() bool
	Healty() bool
}

type KernelRoute

type KernelRoute struct {
	Destination *net.IPNet
	Gateway     net.IP
}

type MeasureInterface

type MeasureInterface interface {
	PathPing(path []int) (float64, error)
}

type Node

type Node struct {
	StopCh          chan struct{}
	WGUpdateCh      chan netctl.WGInterface
	RTUpdateCh      chan struct{}
	MeasureUpdateCh chan struct{}

	RouteTable *RouteTable
	StateTable *StateTable

	Services         map[string]Service
	RouteService     RouteInterface
	ConsensusService ConsensusInterface
	MeasureService   MeasureInterface

	SiteID  int
	LocalIP string
	Peers   []int

	Logger logging.Logger
}

type RouteInterface

type RouteInterface interface {
	GetCentralisedRoute(int) int
	GetGraphRoute(int) int
	UpdateLocalRoutes(map[int]int)
}

type RouteTable

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

func NewRouteTable

func NewRouteTable() *RouteTable

NewRouteTable creates a new RouteTable with initialized map

func (*RouteTable) AddRoute

func (rt *RouteTable) AddRoute(destination *net.IPNet, gateway net.IP)

func (*RouteTable) ClearRoutes

func (rt *RouteTable) ClearRoutes()

func (*RouteTable) GetRoutes

func (rt *RouteTable) GetRoutes() []KernelRoute

func (*RouteTable) Lock

func (rt *RouteTable) Lock()

func (*RouteTable) MarkReady

func (rt *RouteTable) MarkReady()

func (*RouteTable) Ready

func (rt *RouteTable) Ready() bool

func (*RouteTable) Unlock

func (rt *RouteTable) Unlock()

type Service

type Service interface {
	Start() error
}

type StateTable

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

func NewStateTable

func NewStateTable() *StateTable

func (*StateTable) Delete

func (s *StateTable) Delete(key string) error

func (*StateTable) Get

func (s *StateTable) Get(key string) (string, time.Time, error)

Get returns the value associated with the key in the package that called this function. The second return value is the timestamp when the value was set. If the key is not found, the second return value is the zero Time.

func (*StateTable) GetAll

func (s *StateTable) GetAll(namespace string) map[string]string

func (*StateTable) GetFromNamespace

func (s *StateTable) GetFromNamespace(key, namespace string) (string, time.Time, error)

func (*StateTable) Modify

func (s *StateTable) Modify(key, value string) error

func (*StateTable) Set

func (s *StateTable) Set(key, value string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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