persist

package
v0.0.0-...-00f8608 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package persist contains the Persist type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persist

type Persist struct {
	PrivateNodeKey    key.NodePrivate
	OldPrivateNodeKey key.NodePrivate // needed to request key rotation
	UserProfile       tailcfg.UserProfile
	NetworkLockKey    key.NLPrivate
	NodeID            tailcfg.StableNodeID
	AttestationKey    key.HardwareAttestationKey `json:",omitzero"`

	// 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

func (src *Persist) Clone() *Persist

Clone makes a deep copy of Persist. The result aliases no memory with the original.

func (*Persist) Equals

func (p *Persist) Equals(p2 *Persist) bool

func (*Persist) Pretty

func (p *Persist) Pretty() string

func (*Persist) PublicNodeKey

func (p *Persist) PublicNodeKey() key.NodePublic

PublicNodeKey returns the public key for the node key.

func (*Persist) PublicNodeKeyOK

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

func (p *Persist) View() PersistView

View returns a read-only view of Persist.

type PersistView

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

func (v PersistView) AsStruct() *Persist

AsStruct returns a clone of the underlying value which aliases no memory with the original.

func (PersistView) AttestationKey

func (v PersistView) AttestationKey() tailcfg.StableNodeID

func (PersistView) DisallowedTKAStateIDs

func (v PersistView) DisallowedTKAStateIDs() views.Slice[string]

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.

func (PersistView) Equals

func (p PersistView) Equals(p2 PersistView) bool

func (PersistView) MarshalJSON

func (v PersistView) MarshalJSON() ([]byte, error)

MarshalJSON implements jsonv1.Marshaler.

func (PersistView) MarshalJSONTo

func (v PersistView) MarshalJSONTo(enc *jsontext.Encoder) error

MarshalJSONTo implements jsonv2.MarshalerTo.

func (PersistView) NetworkLockKey

func (v PersistView) NetworkLockKey() key.NLPrivate

func (PersistView) NodeID

func (v PersistView) NodeID() tailcfg.StableNodeID

func (PersistView) OldPrivateNodeKey

func (v PersistView) OldPrivateNodeKey() key.NodePrivate

needed to request key rotation

func (PersistView) PrivateNodeKey

func (v PersistView) PrivateNodeKey() key.NodePrivate

func (PersistView) PublicNodeKey

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

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

func (v *PersistView) UnmarshalJSON(b []byte) error

UnmarshalJSON implements jsonv1.Unmarshaler.

func (*PersistView) UnmarshalJSONFrom

func (v *PersistView) UnmarshalJSONFrom(dec *jsontext.Decoder) error

UnmarshalJSONFrom implements jsonv2.UnmarshalerFrom.

func (PersistView) UserProfile

func (v PersistView) UserProfile() tailcfg.UserProfileView

func (PersistView) Valid

func (v PersistView) Valid() bool

Valid reports whether v's underlying value is non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL