persist

package
v0.0.0-...-ded95ce Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-3-Clause Imports: 5 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 {

	// 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
	Provider          string
	LoginName         string
	// contains filtered or unexported fields
}

Persist is the JSON type stored on disk on nodes to remember their settings between runs.

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) View

func (p *Persist) View() PersistView

View returns a readonly 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) LegacyFrontendPrivateMachineKey

func (v PersistView) LegacyFrontendPrivateMachineKey() key.MachinePrivate

func (PersistView) LoginName

func (v PersistView) LoginName() string

func (PersistView) MarshalJSON

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

func (PersistView) OldPrivateNodeKey

func (v PersistView) OldPrivateNodeKey() key.NodePrivate

func (PersistView) PrivateNodeKey

func (v PersistView) PrivateNodeKey() key.NodePrivate

func (PersistView) Provider

func (v PersistView) Provider() string

func (*PersistView) UnmarshalJSON

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

func (PersistView) Valid

func (v PersistView) Valid() bool

Valid reports whether underlying value is non-nil.

Jump to

Keyboard shortcuts

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