This allows providing additional information to the client about how to
select a home DERP region, such as preferring a given DERP region over
all others.
Updates #8603
Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I7c4a270f31d8585112fab5408799ffba5b75266f
//go:generate go run tailscale.com/cmd/viewer --type=User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location --clonefunc
//go:generate go run tailscale.com/cmd/viewer --type=User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPHomeParams,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location --clonefunc
import(
import(
"bytes"
"bytes"
@ -101,7 +101,8 @@ type CapabilityVersion int
// - 62: 2023-05-05: Client can notify control over noise for SSHEventNotificationRequest recording failure events
// - 62: 2023-05-05: Client can notify control over noise for SSHEventNotificationRequest recording failure events
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var_DERPMapCloneNeedsRegeneration=DERPMap(struct{
var_DERPMapCloneNeedsRegeneration=DERPMap(struct{
HomeParams*DERPHomeParams
Regionsmap[int]*DERPRegion
Regionsmap[int]*DERPRegion
OmitDefaultRegionsbool
OmitDefaultRegionsbool
}{})
}{})
@ -484,7 +508,7 @@ var _LocationCloneNeedsRegeneration = Location(struct {
// Clone duplicates src into dst and reports whether it succeeded.
// Clone duplicates src into dst and reports whether it succeeded.
// To succeed, <src, dst> must be of types <*T, *T> or <*T, **T>,
// To succeed, <src, dst> must be of types <*T, *T> or <*T, **T>,
// where T is one of User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location.
// where T is one of User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPHomeParams,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location.
//go:generate go run tailscale.com/cmd/cloner -clonefunc=true -type=User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location
//go:generate go run tailscale.com/cmd/cloner -clonefunc=true -type=User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPHomeParams,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location
// View returns a readonly view of User.
// View returns a readonly view of User.
func(p*User)View()UserView{
func(p*User)View()UserView{
@ -633,6 +633,60 @@ var _RegisterResponseViewNeedsRegeneration = RegisterResponse(struct {
Errorstring
Errorstring
}{})
}{})
// View returns a readonly view of DERPHomeParams.
func(p*DERPHomeParams)View()DERPHomeParamsView{
returnDERPHomeParamsView{ж:p}
}
// DERPHomeParamsView provides a read-only view over DERPHomeParams.
//
// Its methods should only be called if `Valid()` returns true.
typeDERPHomeParamsViewstruct{
// ж is the underlying mutable value, named with a hard-to-type
// character that looks pointy like a pointer.
// It is named distinctively to make you think of how dangerous it is to escape
// to callers. You must not let callers be able to mutate it.
ж*DERPHomeParams
}
// Valid reports whether underlying value is non-nil.