Documentation ¶
Overview ¶
Package persist contains the Persist type.
Index ¶
- type Persist
- type PersistView
- func (v PersistView) AsStruct() *Persist
- func (v PersistView) DisallowedTKAStateIDs() views.Slice[string]
- func (p PersistView) Equals(p2 PersistView) bool
- func (v PersistView) LegacyFrontendPrivateMachineKey() key.MachinePrivate
- func (v PersistView) MarshalJSON() ([]byte, error)
- func (v PersistView) NetworkLockKey() key.NLPrivate
- func (v PersistView) NodeID() tailcfg.StableNodeID
- func (v PersistView) OldPrivateNodeKey() key.NodePrivate
- func (v PersistView) PrivateNodeKey() key.NodePrivate
- func (p PersistView) PublicNodeKey() key.NodePublic
- func (p PersistView) PublicNodeKeyOK() (_ key.NodePublic, ok bool)
- func (v *PersistView) UnmarshalJSON(b []byte) error
- func (v PersistView) UserProfile() tailcfg.UserProfile
- func (v PersistView) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persist ¶
type Persist struct { // LegacyFrontendPrivateMachineKey is here temporarily // (starting 2020-09-28) during migration of Windows users' // machine keys from frontend storage to the backend. On the // first LocalBackend.Start call, the backend will initialize // the real (backend-owned) machine key from the frontend's // provided value (if non-zero), picking a new random one if // needed. This field should be considered read-only from GUI // frontends. The real value should not be written back in // this field, lest the frontend persist it to disk. LegacyFrontendPrivateMachineKey key.MachinePrivate `json:"PrivateMachineKey"` PrivateNodeKey key.NodePrivate OldPrivateNodeKey key.NodePrivate // needed to request key rotation UserProfile tailcfg.UserProfile NetworkLockKey key.NLPrivate NodeID tailcfg.StableNodeID // DisallowedTKAStateIDs stores the tka.State.StateID values which // this node will not operate network lock on. This is used to // prevent bootstrapping TKA onto a key authority which was forcibly // disabled. DisallowedTKAStateIDs []string `json:",omitempty"` // contains filtered or unexported fields }
Persist is the JSON type stored on disk on nodes to remember their settings between runs. This is stored as part of ipn.Prefs and is persisted per ipn.LoginProfile.
func (*Persist) Clone ¶
Clone makes a deep copy of Persist. The result aliases no memory with the original.
func (*Persist) PublicNodeKey ¶ added in v1.32.3
func (p *Persist) PublicNodeKey() key.NodePublic
PublicNodeKey returns the public key for the node key.
func (*Persist) PublicNodeKeyOK ¶ added in v1.62.1
func (p *Persist) PublicNodeKeyOK() (pub key.NodePublic, ok bool)
PublicNodeKeyOK returns the public key for the node key.
Unlike PublicNodeKey, it returns ok=false if there is no node private key instead of panicking.
func (*Persist) View ¶ added in v1.32.3
func (p *Persist) View() PersistView
View returns a readonly view of Persist.
type PersistView ¶ added in v1.32.3
type PersistView struct {
// contains filtered or unexported fields
}
PersistView provides a read-only view over Persist.
Its methods should only be called if `Valid()` returns true.
func (PersistView) AsStruct ¶ added in v1.32.3
func (v PersistView) AsStruct() *Persist
AsStruct returns a clone of the underlying value which aliases no memory with the original.
func (PersistView) DisallowedTKAStateIDs ¶ added in v1.34.0
func (v PersistView) DisallowedTKAStateIDs() views.Slice[string]
func (PersistView) Equals ¶ added in v1.34.0
func (p PersistView) Equals(p2 PersistView) bool
func (PersistView) LegacyFrontendPrivateMachineKey ¶ added in v1.32.3
func (v PersistView) LegacyFrontendPrivateMachineKey() key.MachinePrivate
func (PersistView) MarshalJSON ¶ added in v1.32.3
func (v PersistView) MarshalJSON() ([]byte, error)
func (PersistView) NetworkLockKey ¶ added in v1.34.0
func (v PersistView) NetworkLockKey() key.NLPrivate
func (PersistView) NodeID ¶ added in v1.34.0
func (v PersistView) NodeID() tailcfg.StableNodeID
func (PersistView) OldPrivateNodeKey ¶ added in v1.32.3
func (v PersistView) OldPrivateNodeKey() key.NodePrivate
func (PersistView) PrivateNodeKey ¶ added in v1.32.3
func (v PersistView) PrivateNodeKey() key.NodePrivate
func (PersistView) PublicNodeKey ¶ added in v1.34.0
func (p PersistView) PublicNodeKey() key.NodePublic
PublicNodeKey returns the public key for the node key.
It panics if there is no node private key. See PublicNodeKeyOK.
func (PersistView) PublicNodeKeyOK ¶ added in v1.62.1
func (p PersistView) PublicNodeKeyOK() (_ key.NodePublic, ok bool)
PublicNodeKeyOK returns the public key for the node key.
Unlike PublicNodeKey, it returns ok=false if there is no node private key instead of panicking.
func (*PersistView) UnmarshalJSON ¶ added in v1.32.3
func (v *PersistView) UnmarshalJSON(b []byte) error
func (PersistView) UserProfile ¶ added in v1.34.0
func (v PersistView) UserProfile() tailcfg.UserProfile
func (PersistView) Valid ¶ added in v1.32.3
func (v PersistView) Valid() bool
Valid reports whether underlying value is non-nil.