Movatterモバイル変換


[0]ホーム

URL:


conffile

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:21Imported by:5

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package conffile contains code to load, manipulate, and access config filesettings.

Index

Constants

View Source
const VMUserDataPath = "vm:user-data"

VMUserDataPath is a sentinel value for Load to use to get the datafrom the VM's metadata service's user-data field.

Variables

This section is empty.

Functions

This section is empty.

Types

typeConfig

type Config struct {Pathstring// disk path of HuJSON, or VMUserDataPathRaw     []byte// raw bytes from disk, in HuJSON formStd     []byte// standardized JSON formVersionstring// "alpha0" for now// Parsed is the parsed config, converted from its on-disk version to the// latest known format.//// As of 2023-10-15 there is exactly one format ("alpha0") so this is both// the on-disk format and the in-memory upgraded format.Parsedipn.ConfigVAlpha}

Config describes a config file.

funcLoad

func Load(pathstring) (*Config,error)

Load reads and parses the config file at the provided path on disk.

func (*Config)WantRunning

func (c *Config) WantRunning()bool

WantRunning reports whether c is non-nil and it's configured to be running.

typeServiceDetailsFileadded inv1.90.0

type ServiceDetailsFile struct {// Version is always "0.0.1", set if and only if this is not inside a// [ServiceConfigFile].Versionstring `json:"version,omitzero"`// Endpoints are sets of reverse proxy mappings from ProtoPortRanges on a// Service to Targets (proto+destination+port) on remote destinations (or// localhost).// For example, "tcp:443" -> "tcp://localhost:8000" is an endpoint definition// mapping traffic on the TCP port 443 of the Service to port 8080 on localhost.// The Proto in the key must be populated.// As a special case, if the only mapping provided is "*" -> "TUN", that// enables TUN/L3 mode, where packets are delivered to the Tailscale network// interface with the understanding that the user will deal with them manually.Endpoints map[*tailcfg.ProtoPortRange]*Target `json:"endpoints"`// Advertised is a flag that tells control whether or not the client thinks// it is ready to host a particular Tailscale Service. If unset, it is// assumed to be true.Advertisedopt.Bool `json:"advertised,omitzero"`}

ServiceDetailsFile is the config syntax for an individual Tailscale Service.

typeServiceProtocoladded inv1.90.0

type ServiceProtocolstring

ServiceProtocol is the protocol of a Target.

const (ProtoHTTPServiceProtocol = "http"ProtoHTTPSServiceProtocol = "https"ProtoHTTPSInsecureServiceProtocol = "https+insecure"ProtoTCPServiceProtocol = "tcp"ProtoTLSTerminatedTCPServiceProtocol = "tls-terminated-tcp"ProtoFileServiceProtocol = "file"ProtoTUNServiceProtocol = "TUN")

typeServicesConfigFileadded inv1.90.0

type ServicesConfigFile struct {// Version is always "0.0.1" and always present.Versionstring `json:"version"`Services map[tailcfg.ServiceName]*ServiceDetailsFile `json:"services,omitzero"`}

ServicesConfigFile is the config file format for services configuration.

funcLoadServicesConfigadded inv1.90.0

func LoadServicesConfig(filenamestring, forServicestring) (*ServicesConfigFile,error)

typeTargetadded inv1.90.0

type Target struct {// The protocol over which to communicate with the Destination.// Protocol == ProtoTUN is a special case, activating "TUN mode" where// packets are delivered to the Tailscale TUN interface and then manually// handled by the user.ProtocolServiceProtocol// If Protocol is ProtoFile, then Destination is a file path.// If Protocol is ProtoTUN, then Destination is empty.// Otherwise, it is a host.Destinationstring// If Protocol is not ProtoFile or ProtoTUN, then DestinationPorts is the// set of ports on which to connect to the host referred to by Destination.DestinationPortstailcfg.PortRange}

Target is a destination for traffic to go to when it arrives at a TailscaleService host.

func (*Target)MarshalTextadded inv1.90.0

func (t *Target) MarshalText() ([]byte,error)

func (*Target)UnmarshalJSONadded inv1.90.0

func (t *Target) UnmarshalJSON(buf []byte)error

UnmarshalJSON implements [jsonv1.Unmarshaler].

func (*Target)UnmarshalJSONFromadded inv1.90.0

func (t *Target) UnmarshalJSONFrom(dec *jsontext.Decoder)error

UnmarshalJSONFrom implementsjsonv2.UnmarshalerFrom.

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