Update
This commit is contained in:
1 parent
3530afb854
commit
6903fcff27
2146 files changed
+112256
-190703
No files matched your search
+18
-5
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// Copyright (c) Tailscale Inc & contributors
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
// Package tsd (short for "Tailscale Daemon") contains a System type that
|
||||
@@ -18,7 +18,9 @@
|
||||
package tsd
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"tailscale.com/control/controlknobs"
|
||||
@@ -32,6 +34,7 @@ import (
|
||||
"tailscale.com/net/tstun"
|
||||
"tailscale.com/proxymap"
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/views"
|
||||
"tailscale.com/util/eventbus"
|
||||
"tailscale.com/util/syspolicy/policyclient"
|
||||
"tailscale.com/util/usermetric"
|
||||
@@ -62,6 +65,16 @@ type System struct {
|
||||
PolicyClient SubSystem[policyclient.Client]
|
||||
HealthTracker SubSystem[*health.Tracker]
|
||||
|
||||
// NoiseRoundTripper, if set, provides an http.RoundTripper that
|
||||
// sends requests over the control plane Noise connection.
|
||||
NoiseRoundTripper SubSystem[http.RoundTripper]
|
||||
|
||||
// ExtraRootCAs, if non-nil, specifies additional trusted root CAs
|
||||
// beyond the system roots. On Android, this includes user-installed
|
||||
// CA certificates that Go's crypto/x509 does not see.
|
||||
// It is plumbed through to tlsdial.Config via tls.Config.RootCAs.
|
||||
ExtraRootCAs *x509.CertPool
|
||||
|
||||
// InitialConfig is initial server config, if any.
|
||||
// It is nil if the node is not in declarative mode.
|
||||
// This value is never updated after startup.
|
||||
@@ -111,6 +124,8 @@ type LocalBackend = any
|
||||
type NetstackImpl interface {
|
||||
Start(LocalBackend) error
|
||||
UpdateNetstackIPs(*netmap.NetworkMap)
|
||||
UpdateIPServiceMappings(netmap.IPServiceMappings)
|
||||
UpdateActiveVIPServices(views.Slice[string])
|
||||
}
|
||||
|
||||
// Set is a convenience method to set a subsystem value.
|
||||
@@ -223,8 +238,7 @@ func (p *SubSystem[T]) Set(v T) {
|
||||
return
|
||||
}
|
||||
|
||||
var z *T
|
||||
panic(fmt.Sprintf("%v is already set", reflect.TypeOf(z).Elem().String()))
|
||||
panic(fmt.Sprintf("%v is already set", reflect.TypeFor[T]().String()))
|
||||
}
|
||||
p.v = v
|
||||
p.set = true
|
||||
@@ -233,8 +247,7 @@ func (p *SubSystem[T]) Set(v T) {
|
||||
// Get returns the value of p, panicking if it hasn't been set.
|
||||
func (p *SubSystem[T]) Get() T {
|
||||
if !p.set {
|
||||
var z *T
|
||||
panic(fmt.Sprintf("%v is not set", reflect.TypeOf(z).Elem().String()))
|
||||
panic(fmt.Sprintf("%v is not set", reflect.TypeFor[T]().String()))
|
||||
}
|
||||
return p.v
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user