server

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package server implements a test server for the SideroLink.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NodeProvisioner NodeProvisioner
	ServerAddress   netip.Addr
	ServerEndpoint  netip.AddrPort
	VirtualPrefix   netip.Prefix
	Logger          *zap.Logger
	JoinToken       string
	ServerPublicKey wgtypes.Key
}

Config configures the server.

type NodeProvisioner added in v0.3.5

type NodeProvisioner interface {
	NodePrefix(nodeUUID string, talosVersion string) (netip.Prefix, error)
}

NodeProvisioner is an interface that provides the node ip and prefix.

type Server

type Server struct {
	pb.UnimplementedProvisionServiceServer
	// contains filtered or unexported fields
}

Server implents gRPC API.

func NewServer

func NewServer(cfg Config) *Server

NewServer initializes new server.

func (*Server) EventCh

func (srv *Server) EventCh() <-chan wireguard.PeerEvent

EventCh implements the wireguard.PeerSource interface.

func (*Server) Provision

func (srv *Server) Provision(_ context.Context, req *pb.ProvisionRequest) (*pb.ProvisionResponse, error)

Provision the SideroLink.

Jump to

Keyboard shortcuts

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