apitype

package
v1.76.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: BSD-3-Clause Imports: 2 Imported by: 36

Documentation

Overview

Package apitype contains types for the Tailscale LocalAPI and control plane API.

Index

Constants

View Source
const LocalAPIHost = "local-tailscaled.sock"

LocalAPIHost is the Host header value used by the LocalAPI.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSConfig added in v1.26.0

type DNSConfig struct {
	Resolvers          []DNSResolver            `json:"resolvers"`
	FallbackResolvers  []DNSResolver            `json:"fallbackResolvers"`
	Routes             map[string][]DNSResolver `json:"routes"`
	Domains            []string                 `json:"domains"`
	Nameservers        []string                 `json:"nameservers"`
	Proxied            bool                     `json:"proxied"`
	TempCorpIssue13969 string                   `json:"TempCorpIssue13969,omitempty"`
}

type DNSOSConfig added in v1.74.0

type DNSOSConfig struct {
	Nameservers   []string
	SearchDomains []string
	MatchDomains  []string
}

DNSOSConfig mimics dns.OSConfig without forcing us to import the entire dns package into the CLI.

type DNSQueryResponse added in v1.76.0

type DNSQueryResponse struct {
	// Bytes is the raw DNS response bytes.
	Bytes []byte
	// Resolvers is the list of resolvers that the forwarder deemed able to resolve the query.
	Resolvers []*dnstype.Resolver
}

DNSQueryResponse is the response to a DNS query request sent via LocalAPI.

type DNSResolver added in v1.26.0

type DNSResolver struct {
	Addr                string   `json:"addr"`
	BootstrapResolution []string `json:"bootstrapResolution,omitempty"`
}

type ExitNodeSuggestionResponse added in v1.66.0

type ExitNodeSuggestionResponse struct {
	ID       tailcfg.StableNodeID
	Name     string
	Location tailcfg.LocationView `json:",omitempty"`
}

ExitNodeSuggestionResponse is the response to a LocalAPI suggest-exit-node GET request. It returns the StableNodeID, name, and location of a suggested exit node for the client making the request.

type FileTarget

type FileTarget struct {
	Node *tailcfg.Node

	// PeerAPI is the http://ip:port URL base of the node's PeerAPI,
	// without any path (not even a single slash).
	PeerAPIURL string
}

FileTarget is a node to which files can be sent, and the PeerAPI URL base to do so via.

type ReloadConfigResponse added in v1.52.0

type ReloadConfigResponse struct {
	Reloaded bool   // whether the config was reloaded
	Err      string // any error message
}

ReloadConfigResponse is the response to a LocalAPI reload-config request.

There are three possible outcomes: (false, "") if no config mode in use, (true, "") on success, or (false, "error message") on failure.

type SetPushDeviceTokenRequest added in v1.38.0

type SetPushDeviceTokenRequest struct {
	// PushDeviceToken is the iOS/macOS APNs device token (and any future Android equivalent).
	PushDeviceToken string
}

SetPushDeviceTokenRequest is the body POSTed to the LocalAPI endpoint /set-device-token.

type WaitingFile

type WaitingFile struct {
	Name string
	Size int64
}

type WhoIsResponse

type WhoIsResponse struct {
	Node        *tailcfg.Node
	UserProfile *tailcfg.UserProfile

	// CapMap is a map of capabilities to their values.
	// See tailcfg.PeerCapMap and tailcfg.PeerCapability for details.
	CapMap tailcfg.PeerCapMap
}

WhoIsResponse is the JSON type returned by tailscaled debug server's /whois?ip=$IP handler. In successful whois responses, Node and UserProfile are never nil.

Jump to

Keyboard shortcuts

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