@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated by tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse; DO NOT EDIT.
// Code generated by tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse; DO NOT EDIT.
package tailcfg
@ -26,7 +26,7 @@ func (src *User) Clone() *User {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _UserNeedsRegeneration = User ( struct {
ID UserID
LoginName string
@ -58,7 +58,7 @@ func (src *Node) Clone() *Node {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _NodeNeedsRegeneration = Node ( struct {
ID NodeID
StableID StableNodeID
@ -100,7 +100,7 @@ func (src *Hostinfo) Clone() *Hostinfo {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _HostinfoNeedsRegeneration = Hostinfo ( struct {
IPNVersion string
FrontendLogID string
@ -137,7 +137,7 @@ func (src *NetInfo) Clone() *NetInfo {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _NetInfoNeedsRegeneration = NetInfo ( struct {
MappingVariesByDestIP opt . Bool
HairPinning opt . Bool
@ -164,7 +164,7 @@ func (src *Login) Clone() *Login {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _LoginNeedsRegeneration = Login ( struct {
_ structs . Incomparable
ID LoginID
@ -183,18 +183,49 @@ func (src *DNSConfig) Clone() *DNSConfig {
}
dst := new ( DNSConfig )
* dst = * src
dst . Nameservers = append ( src . Nameservers [ : 0 : 0 ] , src . Nameservers ... )
dst . Resolvers = make ( [ ] DNSResolver , len ( src . Resolvers ) )
for i := range dst . Resolvers {
dst . Resolvers [ i ] = * src . Resolvers [ i ] . Clone ( )
}
if dst . Routes != nil {
dst . Routes = map [ string ] [ ] DNSResolver { }
for k := range src . Routes {
dst . Routes [ k ] = append ( [ ] DNSResolver { } , src . Routes [ k ] ... )
}
}
dst . Domains = append ( src . Domains [ : 0 : 0 ] , src . Domains ... )
dst . Nameservers = append ( src . Nameservers [ : 0 : 0 ] , src . Nameservers ... )
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _DNSConfigNeedsRegeneration = DNSConfig ( struct {
Nameservers [ ] netaddr . IP
Resolvers [ ] DNSResolver
Routes map [ string ] [ ] DNSResolver
Domains [ ] string
PerDomain bool
Proxied bool
Nameservers [ ] netaddr . IP
PerDomain bool
} { } )
// Clone makes a deep copy of DNSResolver.
// The result aliases no memory with the original.
func ( src * DNSResolver ) Clone ( ) * DNSResolver {
if src == nil {
return nil
}
dst := new ( DNSResolver )
* dst = * src
dst . BootstrapResolution = append ( src . BootstrapResolution [ : 0 : 0 ] , src . BootstrapResolution ... )
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,DNSResolver,RegisterResponse
var _DNSResolverNeedsRegeneration = DNSResolver ( struct {
Addr string
BootstrapResolution [ ] netaddr . IP
} { } )
// Clone makes a deep copy of RegisterResponse.
@ -210,7 +241,7 @@ func (src *RegisterResponse) Clone() *RegisterResponse {
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, RegisterResponse
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse
var _RegisterResponseNeedsRegeneration = RegisterResponse ( struct {
User User
Login Login
@ -221,7 +252,7 @@ var _RegisterResponseNeedsRegeneration = RegisterResponse(struct {
// Clone duplicates src into dst and reports whether it succeeded.
// 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.
// where T is one of User,Node,Hostinfo,NetInfo,Login,DNSConfig, DNSResolver, RegisterResponse.
func Clone ( dst , src interface { } ) bool {
switch src := src . ( type ) {
case * User :
@ -278,6 +309,15 @@ func Clone(dst, src interface{}) bool {
* dst = src . Clone ( )
return true
}
case * DNSResolver :
switch dst := dst . ( type ) {
case * DNSResolver :
* dst = * src . Clone ( )
return true
case * * DNSResolver :
* dst = src . Clone ( )
return true
}
case * RegisterResponse :
switch dst := dst . ( type ) {
case * RegisterResponse :