mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-04 00:41:46 +01:00
Extend Persist with AttestationKey to record a hardware-backed attestation key for the node's identity. Add a flag to tailscaled to allow users to control the use of hardware-backed keys to bind node identity to individual machines. Updates tailscale/corp#31269 Change-Id: Idcf40d730a448d85f07f1bebf387f086d4c58be3 Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
83 lines
2.0 KiB
Go
83 lines
2.0 KiB
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
// Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
|
|
|
|
package clonerex
|
|
|
|
import (
|
|
"tailscale.com/types/ptr"
|
|
)
|
|
|
|
// Clone makes a deep copy of SliceContainer.
|
|
// The result aliases no memory with the original.
|
|
func (src *SliceContainer) Clone() *SliceContainer {
|
|
if src == nil {
|
|
return nil
|
|
}
|
|
dst := new(SliceContainer)
|
|
*dst = *src
|
|
if src.Slice != nil {
|
|
dst.Slice = make([]*int, len(src.Slice))
|
|
for i := range dst.Slice {
|
|
if src.Slice[i] == nil {
|
|
dst.Slice[i] = nil
|
|
} else {
|
|
dst.Slice[i] = ptr.To(*src.Slice[i])
|
|
}
|
|
}
|
|
}
|
|
return dst
|
|
}
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
var _SliceContainerCloneNeedsRegeneration = SliceContainer(struct {
|
|
Slice []*int
|
|
}{})
|
|
|
|
// Clone makes a deep copy of InterfaceContainer.
|
|
// The result aliases no memory with the original.
|
|
func (src *InterfaceContainer) Clone() *InterfaceContainer {
|
|
if src == nil {
|
|
return nil
|
|
}
|
|
dst := new(InterfaceContainer)
|
|
*dst = *src
|
|
if src.Interface != nil {
|
|
dst.Interface = src.Interface.Clone()
|
|
}
|
|
return dst
|
|
}
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
var _InterfaceContainerCloneNeedsRegeneration = InterfaceContainer(struct {
|
|
Interface Cloneable
|
|
}{})
|
|
|
|
// 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 SliceContainer,InterfaceContainer.
|
|
func Clone(dst, src any) bool {
|
|
switch src := src.(type) {
|
|
case *SliceContainer:
|
|
switch dst := dst.(type) {
|
|
case *SliceContainer:
|
|
*dst = *src.Clone()
|
|
return true
|
|
case **SliceContainer:
|
|
*dst = src.Clone()
|
|
return true
|
|
}
|
|
case *InterfaceContainer:
|
|
switch dst := dst.(type) {
|
|
case *InterfaceContainer:
|
|
*dst = *src.Clone()
|
|
return true
|
|
case **InterfaceContainer:
|
|
*dst = src.Clone()
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|