tsnet

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: BSD-3-Clause Imports: 20 Imported by: 168

Documentation

Overview

Package tsnet provides Tailscale as a library.

It is an experimental work in progress.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// Dir specifies the name of the directory to use for
	// state. If empty, a directory is selected automatically
	// under os.UserConfigDir (https://golang.org/pkg/os/#UserConfigDir).
	// based on the name of the binary.
	Dir string

	// Hostname is the hostname to present to the control server.
	// If empty, the binary name is used.l
	Hostname string

	// Logf, if non-nil, specifies the logger to use. By default,
	// log.Printf is used.
	Logf logger.Logf
	// contains filtered or unexported fields
}

Server is an embedded Tailscale server.

Its exported fields may be changed until the first call to Listen.

func (*Server) Listen

func (s *Server) Listen(network, addr string) (net.Listener, error)

func (*Server) WhoIs

func (s *Server) WhoIs(addr string) (w *apitype.WhoIsResponse, ok bool)

WhoIs reports the node and user who owns the node with the given address. The addr may be an ip:port (as from an http.Request.RemoteAddr) or just an IP address.

Directories

Path Synopsis
example
tshello
The tshello server demonstrates how to use Tailscale as a library.
The tshello server demonstrates how to use Tailscale as a library.

Jump to

Keyboard shortcuts

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