Movatterモバイル変換


[0]ホーム

URL:


apitype

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:3Imported by:46

Details

Repository

github.com/tailscale/tailscale

Links

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.

View Source
const RequestReasonHeader = "X-Tailscale-Reason"

RequestReasonHeader is the header used to pass justification for a LocalAPI request,such as when a user wants to perform an action they don't have permission for,and a policy allows it with justification. As of 2025-01-29, it is only used toallow a user to disconnect Tailscale when the "always-on" mode is enabled.

The header value is base64-encoded using the standard encoding defined inRFC 4648.

See tailscale/corp#26146.

Variables

View Source
var RequestReasonKey =ctxkey.New(RequestReasonHeader, "")

RequestReasonKey is the context key used to pass the request reasonwhen making a LocalAPI request via [local.Client].It's value is a raw string. An empty string means no reason was provided.

See tailscale/corp#26146.

Functions

This section is empty.

Types

typeDNSConfigadded inv1.26.0

type DNSConfig struct {// Resolvers are the global DNS resolvers to use// overriding the local OS configuration.Resolvers []DNSResolver `json:"resolvers"`// FallbackResolvers are used as global resolvers when// the client is unable to determine the OS's preferred DNS servers.FallbackResolvers []DNSResolver `json:"fallbackResolvers"`// Routes map DNS name suffixes to a set of DNS resolvers,// used for Split DNS and other advanced routing overlays.Routes map[string][]DNSResolver `json:"routes"`// Domains are the search domains to use.Domains []string `json:"domains"`// Proxied means MagicDNS is enabled.Proxiedbool `json:"proxied"`// TempCorpIssue13969 is from an internal hack day prototype,// See tailscale/corp#13969.TempCorpIssue13969string `json:"TempCorpIssue13969,omitempty"`// Nameservers are the IP addresses of global nameservers to use.// This is a deprecated format but may still be found in tailnets// that were configured a long time ago. When making updates,// set Resolvers and leave Nameservers empty.Nameservers []string `json:"nameservers"`}

DNSConfig is the DNS configuration for a tailnetused in /tailnet/{tailnet}/dns/config.

typeDNSOSConfigadded inv1.74.0

type DNSOSConfig struct {Nameservers   []stringSearchDomains []stringMatchDomains  []string}

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

typeDNSQueryResponseadded inv1.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.

typeDNSResolveradded inv1.26.0

type DNSResolver struct {// Addr is the address of the DNS resolver.// It is usually an IP address or a DoH URL.// See dnstype.Resolver.Addr for full details.Addrstring `json:"addr"`// BootstrapResolution is an optional suggested resolution for// the DoT/DoH resolver.BootstrapResolution []string `json:"bootstrapResolution,omitempty"`// UseWithExitNode signals this resolver should be used// even when a tailscale exit node is configured on a device.UseWithExitNodebool `json:"useWithExitNode,omitempty"`}

DNSResolver is a DNS resolver in a DNS configuration.

typeExitNodeSuggestionResponseadded inv1.66.0

type ExitNodeSuggestionResponse struct {IDtailcfg.StableNodeIDNamestringLocationtailcfg.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.

typeFileTarget

type FileTarget struct {Node *tailcfg.Node// PeerAPI is thehttp://ip:port URL base of the node's PeerAPI,// without any path (not even a single slash).PeerAPIURLstring}

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

typeOptionalFeaturesadded inv1.90.4

type OptionalFeatures struct {// Features is the map of optional feature names to whether they are// enabled.//// Disabled features may be absent from the map. (That is, false values// are not guaranteed to be present.)Features map[string]bool}

OptionalFeatures describes which optional features are enabled in the build.

typeReloadConfigResponseadded inv1.52.0

type ReloadConfigResponse struct {Reloadedbool// whether the config was reloadedErrstring// 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.

typeSetPushDeviceTokenRequestadded inv1.38.0

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

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

typeWaitingFile

type WaitingFile struct {NamestringSizeint64}

typeWhoIsResponse

type WhoIsResponse struct {Node        *tailcfg.NodeUserProfile *tailcfg.UserProfile// CapMap is a map of capabilities to their values.// See tailcfg.PeerCapMap and tailcfg.PeerCapability for details.CapMaptailcfg.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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp