conffile
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package conffile contains code to load, manipulate, and access config filesettings.
Index¶
Constants¶
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.
func (*Config)WantRunning¶
WantRunning reports whether c is non-nil and it's configured to be running.
typeServiceDetailsFile¶added 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.
typeServiceProtocol¶added 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")
typeServicesConfigFile¶added 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.
funcLoadServicesConfig¶added inv1.90.0
func LoadServicesConfig(filenamestring, forServicestring) (*ServicesConfigFile,error)
typeTarget¶added 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)MarshalText¶added inv1.90.0
func (*Target)UnmarshalJSON¶added inv1.90.0
UnmarshalJSON implements [jsonv1.Unmarshaler].
func (*Target)UnmarshalJSONFrom¶added inv1.90.0
UnmarshalJSONFrom implementsjsonv2.UnmarshalerFrom.