testcontrol

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: BSD-3-Clause Imports: 22 Imported by: 4

Documentation

Overview

Package testcontrol contains a minimal control plane server for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Logf    logger.Logf      // nil means to use the log package
	DERPMap *tailcfg.DERPMap // nil means to use prod DERP map
	// contains filtered or unexported fields
}

Server is a control plane server. Its zero value is ready for use. Everything is stored in-memory in one tailnet.

func (*Server) MapResponse

func (s *Server) MapResponse(req *tailcfg.MapRequest) (res *tailcfg.MapResponse, err error)

MapResponse generates a MapResponse for a MapRequest.

No updates to s are done here.

func (*Server) Node

func (s *Server) Node(nodeKey tailcfg.NodeKey) *tailcfg.Node

Node returns the node for nodeKey. It's always nil or cloned memory.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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