Documentation
¶
Overview ¶
Package state persists the agent's identity between runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type State ¶
type State struct {
PrivateKey wgkey.Key `json:"privateKey"`
CoordinatorURL string `json:"coordinatorURL,omitempty"`
NodeID string `json:"nodeID,omitempty"`
NodeToken string `json:"nodeToken,omitempty"`
Name string `json:"name,omitempty"`
// Address is the node's mesh address (CIDR). Userspace mode needs it
// before the first netmap arrives.
Address string `json:"address,omitempty"`
}
State is everything the agent must remember across restarts.
func Load ¶
Load reads the state from dir, generating a fresh private key if no state file exists yet.
func (*State) Registered ¶
Registered reports whether the node holds a token for coordinatorURL.
Click to show internal directories.
Click to hide internal directories.