appc
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 appc implements App Connectors.An AppConnector provides DNS domain oriented routing of traffic. An AppConnector becomes a DNS server for a peer, authoritative for the set ofconfigured domains. DNS resolution of the target domain triggers dynamicpublication of routes to ensure that traffic to the domain is routed throughthe App Connector.
Index¶
- type AppConnector
- func (e *AppConnector) ClearRoutes() error
- func (e *AppConnector) Close()
- func (e *AppConnector) DomainRoutes() map[string][]netip.Addr
- func (e *AppConnector) Domains() views.Slice[string]
- func (e *AppConnector) ObserveDNSResponse(res []byte) error
- func (e *AppConnector) ShouldStoreRoutes() bool
- func (e *AppConnector) UpdateDomains(domains []string)
- func (e *AppConnector) UpdateDomainsAndRoutes(domains []string, routes []netip.Prefix)
- func (e *AppConnector) Wait(ctx context.Context)
- type Config
- type RouteAdvertiser
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeAppConnector¶added inv1.54.0
type AppConnector struct {// contains filtered or unexported fields}AppConnector is an implementation of an AppConnector that performsits function as a subsystem inside of a tailscale node. At the control planeside App Connector routing is configured in terms of domains rather than IPaddresses.The AppConnectors responsibility inside tailscaled is to apply the routingand domain configuration as supplied in the map response.DNS requests for configured domains are observed. If the domains resolve toroutes not yet served by the AppConnector the local node configuration isupdated to advertise the new route.
funcNewAppConnector¶added inv1.54.0
func NewAppConnector(cConfig) *AppConnector
NewAppConnector creates a new AppConnector.
func (*AppConnector)ClearRoutes¶added inv1.66.0
func (e *AppConnector) ClearRoutes()error
ClearRoutes removes all route state from the AppConnector.
func (*AppConnector)Close¶added inv1.90.0
func (e *AppConnector) Close()
Close closes the connector and cleans up resources associated with it.It is safe (and a noop) to call Close on nil.
func (*AppConnector)DomainRoutes¶added inv1.54.0
func (e *AppConnector) DomainRoutes() map[string][]netip.Addr
DomainRoutes returns a map of domains to resolved IPaddresses.
func (*AppConnector)Domains¶added inv1.54.0
func (e *AppConnector) Domains()views.Slice[string]
Domains returns the currently configured domain list.
func (*AppConnector)ObserveDNSResponse¶added inv1.54.0
func (e *AppConnector) ObserveDNSResponse(res []byte)error
ObserveDNSResponse is a callback invoked by the DNS resolver when a DNSresponse is being returned over the PeerAPI. The response is parsed andmatched against the configured domains, if matched the routeAdvertiser isadvised to advertise the discovered route.
func (*AppConnector)ShouldStoreRoutes¶added inv1.66.0
func (e *AppConnector) ShouldStoreRoutes()bool
ShouldStoreRoutes returns true if the appconnector was created with the controlknob onand is storing its discovered routes persistently.
func (*AppConnector)UpdateDomains¶added inv1.54.0
func (e *AppConnector) UpdateDomains(domains []string)
UpdateDomains asynchronously replaces the current set of configured domainswith the supplied set of domains. Domains must not contain a trailing dot,and should be lower case. If the domain contains a leading '*' label itmatches all subdomains of a domain.
func (*AppConnector)UpdateDomainsAndRoutes¶added inv1.58.1
func (e *AppConnector) UpdateDomainsAndRoutes(domains []string, routes []netip.Prefix)
UpdateDomainsAndRoutes starts an asynchronous update of the configurationgiven the new domains and routes.
func (*AppConnector)Wait¶added inv1.58.1
func (e *AppConnector) Wait(ctxcontext.Context)
Wait waits for the currently scheduled asynchronous configuration changes tocomplete.
typeConfig¶added inv1.90.0
type Config struct {// Logf is the logger to which debug logs from the connector will be sent.// It must be non-nil.Logflogger.Logf// EventBus receives events when the collection of routes maintained by the// connector is updated. It must be non-nil.EventBus *eventbus.Bus// RouteAdvertiser allows the connector to update the set of advertised routes.RouteAdvertiserRouteAdvertiser// RouteInfo, if non-nil, use used as the initial set of routes for the// connector. If nil, the connector starts empty.RouteInfo *appctype.RouteInfo// HasStoredRoutes indicates that the connector should assume stored routes.HasStoredRoutesbool}Config carries the settings for anAppConnector.
typeRouteAdvertiser¶added inv1.54.0
type RouteAdvertiser interface {// AdvertiseRoute adds one or more route advertisements skipping any that// are already advertised.AdvertiseRoute(...netip.Prefix)error// UnadvertiseRoute removes any matching route advertisements.UnadvertiseRoute(...netip.Prefix)error}RouteAdvertiser is an interface that allows the AppConnector to advertisenewly discovered routes that need to be served through the AppConnector.