server

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MPL-2.0 Imports: 12 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 {
	NodePrefix      netip.Prefix
	ServerAddress   netip.Addr
	ServerEndpoint  netip.AddrPort
	JoinToken       string
	ServerPublicKey wgtypes.Key
	Logger          *zap.Logger
}

Config configures the server.

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