Documentation
¶
Index ¶
- Constants
- func CanonicalName(name string) string
- func ConfigDir() (string, error)
- func DefaultConfigPath() (string, error)
- func HasAll(have, want []string) bool
- func JoinURL(base, path string) string
- func NormalizePort(p string) string
- func PortsEqual(a, b []string) bool
- func ResolvePath(explicit string) (string, error)
- type Access
- type Check
- type File
- func (f *File) AutostartNames() []string
- func (f *File) ExpandForRuntime(names []string) ([]Service, error)
- func (f *File) HostTags() []string
- func (f *File) Lookup(name string) (Service, bool)
- func (f *File) Names() []string
- func (f *File) ServeConfig() *ServeFile
- func (f *File) VIPServices() []tailscale.Service
- func (f *File) Validate() error
- type Kind
- type Launch
- type LaunchSpec
- type ServeFile
- type ServeService
- type Service
Constants ¶
const ( DefaultEndpoint = "tcp:443" ServeVersion = "0.0.1" )
const DefaultFilename = "catalog.yaml"
Variables ¶
This section is empty.
Functions ¶
func CanonicalName ¶
CanonicalName strips a leading "svc:" so CLI args and API names match.
func DefaultConfigPath ¶
DefaultConfigPath is the XDG catalog file path (may not exist yet).
func NormalizePort ¶
NormalizePort accepts "443" or "tcp:443" and returns "tcp:443".
func PortsEqual ¶
func ResolvePath ¶
ResolvePath picks the catalog file. explicit is the -f flag; empty means auto-discover. Order: -f → TSCATALOG_CATALOG → $XDG_CONFIG_HOME/tscatalog/catalog.yaml (if present) → ./catalog.yaml (if present).
Types ¶
type Check ¶
type Check struct {
Path string `yaml:"path"`
Expect []int `yaml:"expect"`
Public []int `yaml:"public"`
}
Check is optional HTTP probing on top of a TCP bind check.
func (Check) LocalExpect ¶
func (Check) PublicExpect ¶
type File ¶
type File struct {
Endpoint string `yaml:"endpoint"`
Access Access `yaml:"access"`
Services []Service `yaml:"services"`
}
File is the on-disk catalog.
func (*File) AutostartNames ¶
AutostartNames is the catalog names with autostart: true, in file order.
func (*File) ExpandForRuntime ¶
ExpandForRuntime returns services to start or probe, with each requires chain before its dependent. When names is empty, every catalog row is included in dependency order. Stop does not use this — only explicitly named services stop.
func (*File) HostTags ¶
HostTags is the identity stamped on VIP Services so tagged hosts can auto-approve via autoApprovers.services["tag:…"] (svc:* is not a valid key).
func (*File) ServeConfig ¶
func (*File) VIPServices ¶
type Launch ¶
type Launch []LaunchSpec
Launch is one process spec or several (UI + API).
type LaunchSpec ¶
type LaunchSpec struct {
Kind string `yaml:"kind,omitempty"`
Name string `yaml:"name,omitempty"`
Cwd string `yaml:"cwd"`
Start []string `yaml:"start"`
Stop []string `yaml:"stop"`
Detach bool `yaml:"detach"`
Services []string `yaml:"services,omitempty"`
Files []string `yaml:"files,omitempty"`
Status []string `yaml:"status,omitempty"`
Logs []string `yaml:"logs,omitempty"`
}
LaunchSpec is how this host starts one slot. start/stop/status/logs are argv (not a shell). Kind may be omitted: a strict `docker compose up` argv is compose, Detach selects a watched process, and anything else is an external helper.
func (LaunchSpec) ComposeSource ¶
func (s LaunchSpec) ComposeSource() (services, files []string, project string, err error)
ComposeSource is the compose working set for this spec. An explicit kind uses Files and Services and an empty project name. An inferred argv supplies files, services, and the project name.
func (LaunchSpec) ID ¶
func (s LaunchSpec) ID(index int) string
ID is the slot name, or the decimal index when Name is empty.
func (LaunchSpec) ResolveKind ¶
func (s LaunchSpec) ResolveKind() (Kind, error)
ResolveKind returns the explicit kind, or infers one when Kind is empty. Compose is tested before detach, so a compose argv with detach is compose and then rejected by Validate.
func (LaunchSpec) Warnings ¶
func (s LaunchSpec) Warnings() []string
Warnings is set only for an external helper missing status or logs. Validate does not call Warnings. Load still succeeds when those argv are omitted.
type ServeFile ¶
type ServeFile struct {
Version string `json:"version"`
Services map[string]ServeService `json:"services"`
}
ServeFile is the JSON document for `tailscale serve set-config`.
type ServeService ¶
type Service ¶
type Service struct {
Name string `yaml:"name"`
VIP string `yaml:"vip,omitempty"`
DisplayName string `yaml:"displayName"`
Local string `yaml:"local"`
Comment string `yaml:"comment"`
Requires []string `yaml:"requires,omitempty"`
Unpublished bool `yaml:"unpublished,omitempty"`
Autostart bool `yaml:"autostart,omitempty"`
Launch Launch `yaml:"launch"`
Check Check `yaml:"check"`
}
func (Service) Published ¶
Published reports whether this row gets VIP, Serve, advertise, and ACL grants.
func (Service) TailscaleLabel ¶
TailscaleLabel is the single DNS label used for svc:* and https://<label>.<tailnet>.ts.net. When name contains dots, set vip explicitly or it defaults to dots replaced by hyphens.