package
0.23.0-beta3.patch5
Repository: https://github.com/tpuljak/headscale.git
Documentation: pkg.go.dev
# Functions
AssignNodeToUser assigns a Node to a user.
CreatePreAuthKey creates a new PreAuthKey in a user, and returns it.
CreateUser creates a new User.
DeleteNode deletes a Node from the database.
No description provided by the author
DestroyPreAuthKey destroys a preauthkey.
DestroyUser destroys a User.
No description provided by the author
EnableAutoApprovedRoutes enables any routes advertised by a node that match the ACL autoApprovers policy.
No description provided by the author
No description provided by the author
MarkExpirePreAuthKey marks a PreAuthKey as expired.
FailoverNodeRoutesIfNeccessary takes a node and checks if the node's route need to be failed over to another host.
No description provided by the author
GetAdvertisedRoutes returns the routes that are be advertised by the given node.
GetEnabledRoutes returns the routes that are enabled for the node.
No description provided by the author
GetNodeByAnyKey finds a Node by its MachineKey, its current NodeKey or the old one, and returns the Node struct.
GetNodeByID finds a Node by ID and returns the Node struct.
GetNodeByMachineKey finds a Node by its MachineKey and returns the Node struct.
getNodePrimaryRoutes returns the routes that are enabled and marked as primary (for subnet failover) Exit nodes are not considered for this, as they are never marked as Primary.
No description provided by the author
GetPreAuthKey returns a PreAuthKey for a given key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ListNodesByUser gets all the nodes in a given user.
ListPeers returns all peers of node, regardless of any Policy or if the node is expired.
ListPreAuthKeys returns the list of PreAuthKeys for a user.
ListUsers gets all the existing users.
NewEphemeralGarbageCollector creates a new EphemeralGarbageCollector, it takes a deleteFunc that will be called when a node is scheduled for deletion.
TODO(kradalby): assemble this struct from toptions or something typed rather than arguments.
NewIPAllocator returns a new IPAllocator singleton which can be used to hand out unique IP addresses within the provided IPv4 and IPv6 prefix.
NodeSave saves a node object to the database, prefer to use a specific save method rather than this.
NodeSetExpiry takes a Node struct and a new expiry time.
NodeSetMachineKey sets the node key of a node and saves it to the database.
NodeSetNodeKey sets the node key of a node and saves it to the database.
No description provided by the author
RegisterNode is executed from the CLI to register a new Node using its MachineKey.
No description provided by the author
RenameNode takes a Node struct and a new GivenName for the nodes and renames it.
RenameUser renames a User.
SaveNodeRoutes takes a node and updates the database with the new routes.
SetLastSeen sets a node's last seen field indicating that we have recently communicating with this node.
SetTags takes a Node struct pointer and update the forced tags.
UsePreAuthKey marks a PreAuthKey as used.
ValidatePreAuthKey does the heavy lifting for validation of the PreAuthKey coming from a node If returns no error and a PreAuthKey, it can be used.
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
EphemeralGarbageCollector is a garbage collector that will delete nodes after a certain amount of time.
No description provided by the author
IPAllocator is a singleton responsible for allocating IP addresses for nodes and making sure the same address is not handed out twice.
KV is a key-value store in a psql table.