package
0.25.0
Repository: https://github.com/gravitl/netmaker.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AddHook - adds a hook function to run every 24hrs.
No description provided by the author
AddNetworkToAllocatedIpMap - add network to allocated ip map when network is added.
AssociateNodeToHost - associates and creates a node with a given host should be the only way nodes get created as of 0.18.
CheckAndRemoveLegacyNode - checks for legacy node and removes.
CheckEndpoint - checks if an endpoint is valid.
CheckHostPort checks host endpoints to ensures that hosts on the same server with the same endpoint have different listen ports in the case of 64535 hosts or more with same endpoint, ports will not be changed.
CheckIfFileExists - checks if file exists or not in the given path.
CheckZombies - checks if new node has same hostid as existing node if so, existing node is added to zombie node quarantine list also cleans up nodes past their expiration date.
ClearAllocatedIpMap - set allocatedIpMap to nil.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ConvHostPassToHash - converts password to md5 hash.
CreateDNS - creates a DNS entry.
CreateEgressGateway - creates an egress gateway.
CreateEnrollmentKey - creates a new enrollment key in db.
CreateExtClient - creates and saves an extclient.
CreateHost - creates a host if not exist.
CreateIngressGateway - creates an ingress gateway.
CreateJWT func will used to create the JWT while signing in and signing out.
CreateNetwork - creates a network in database.
CreateSuperAdmin - creates an super admin user.
CreateUser - creates a user.
CreateUserJWT - creates a user jwt token.
DeleteDNS - deletes a DNS entry.
DeleteEgressGateway - deletes egress from node.
DeleteEnrollmentKey - delete's a given enrollment key by value.
DeleteExpiredNodes - goroutine which deletes nodes which are expired.
DeleteExtClient - deletes an existing ext client.
DeleteExtClientAndCleanup - deletes an existing ext client and update ACLs.
DeleteGatewayExtClients - deletes ext clients based on gateway (mac) of ingress node and network.
DeleteIngressGateway - deletes an ingress gateway.
DeleteNetwork - deletes a network.
DeleteNode - marks node for deletion (and adds to zombie list) if called by UI or deletes node if called by node.
DeleteNodeByID - deletes a node from database.
No description provided by the author
DeleteUser - deletes a given user.
No description provided by the author
DeTokenize - detokenizes a base64 encoded string and finds the associated enrollment key.
DisassociateAllNodesFromHost - deletes all nodes of the host.
DissasociateNodeFromHost - deletes a node and removes from host nodes should be the only way nodes are deleted as of 0.18.
EnterpriseCheck - Runs enterprise functions if presented.
FetchAuthSecret - manages secrets for oauth.
FetchJWTSecret - fetches jwt secret from db.
No description provided by the author
FetchTelemetryData - fetches telemetry data: count of various object types in DB.
FetchTelemetryRecord - get the existing UUID and Timestamp from the DB.
FileExists - checks if local file exists.
FindRelay - returns the node that is the relay for a relayed node.
FormatError - takes ErrorResponse and uses correct code.
GetAllDNS - gets all dns entries.
GetAllEgresses - gets all the nodes that are egresses.
GetAllEnrollmentKeys - fetches all enrollment keys from DB TODO drop double pointer.
GetAllExtClients - gets all ext clients from DB.
GetAllFailOvers - gets all the nodes that are failovers.
GetAllHosts - returns all hosts in flat list or error.
GetAllHostsAPI - get's all the hosts in an API usable format.
GetAllIngresses - gets all the nodes that are ingresses.
GetAllNodes - returns all nodes in the DB.
GetAllNodesAPI - get all nodes for api usage.
GetAllowedIPs - calculates the wireguard allowedip field for a peer of a node based on the peer and node settings.
GetCustomDNS - gets the custom DNS of a network.
GetDefaultHosts - retrieve all hosts marked as default from DB.
GetDeletedNodeByID - get a deleted node.
GetDNS - gets the DNS of a current network.
GetDNSEntryNum - gets which entry the dns was.
No description provided by the author
ExtClient.GetEgressRangesOnNetwork - returns the egress ranges on network of ext client.
GetEnrollmentKey - fetches a single enrollment key returns nil and error if not found.
GetExtClient - gets a single ext client on a network.
No description provided by the author
GetExtClientByName - gets an ext client by name.
GetExtClient - gets a single ext client on a network.
GetExtclientDNS - gets all extclients dns entries.
GetExtClientsByID - gets the clients of attached gateway.
No description provided by the author
GetGwExtclients - return all ext clients attached to the passed gw id.
GetHost - gets a host from db given id.
GetHostByNodeID - returns a host if found to have a node's ID, else nil.
GetHostByPubKey - gets a host from db given pubkey.
GetHostNetworks - fetches all the networks.
GetHostNodes - fetches all nodes part of the host.
GetHostsMap - gets all the current hosts on machine in a map.
GetIngressGwUsers - lists the users having to access to ingressGW.
GetInternetGateways - gets all the nodes that are internet gateways.
GetNetwork - gets a network from database.
GetNetworkByNode - gets the network model from a node.
GetNetworkExtClients - gets the ext clients of given network.
GetNetworkNodes - gets the nodes of a network.
GetNetworkNodesMemory - gets all nodes belonging to a network from list in memory.
GetNetworkNonServerNodeCount - get number of network non server nodes.
GetNetworks - returns all networks from database.
GetNetworkSettings - get parent network.
GetNodeByHostRef - gets the node by host id and network.
No description provided by the author
GetNodeDNS - gets the DNS of a network node.
GetParentNetwork - get parent network.
GetPeerListenPort - given a host, retrieve it's appropriate listening port.
GetPeerUpdateForHost - gets the consolidated peer update for the host from all networks.
GetRecordKey - get record key depricated.
GetRelatedHosts - fetches related hosts of a given host.
GetReturnUser - gets a user.
GetRole - fetches role template by id.
GetState - gets an SsoState from DB, if expired returns error.
GetSuperAdmin - fetches superadmin user.
GetUser - gets a user TODO support "masteradmin".
No description provided by the author
No description provided by the author
No description provided by the author
GetUsers - gets users.
GetUsersDB - gets users.
HasSuperAdmin - checks if server has an superadmin/owner.
HostExists - checks if given host already exists.
IfaceDelta - checks if the new node causes an interface change.
InitializeZombies - populates the zombie quarantine list (should be called from initialization).
No description provided by the author
No description provided by the author
IsAddressInCIDR - util to see if an address is in a cidr or not.
IsBase64 - checks if a string is in base64 format This is used to validate public keys (make sure they're base64 encoded like all public keys should be).
IsInternetGw - checks if node is acting as internet gw.
IsIPUnique - checks if an IP is unique.
IsLegacyNode - checks if a node is legacy or not.
No description provided by the author
IsNetworkNameUnique - checks to see if any other networks have the same name (id).
IsNodeIDUnique - checks if node id is unique.
IsOauthUser - returns.
No description provided by the author
IsSlicesEqual tells whether a and b contain the same elements.
IsStateValid - checks if given state is valid or not deletes state after call is made to clean up, should only be called once per sign-in.
IsUserAllowedAccessToExtClient - checks if user has permission to access extclient.
IsVersionCompatible checks that the version passed is compabtible (>=) with MinVersion.
No description provided by the author
ListPlatformRoles - lists user platform roles permission templates.
No description provided by the author
ManageZombies - goroutine which adds/removes/deletes nodes from the zombie node quarantine list.
NetIDInNetworkCharSet - checks if a netid of a network uses valid characters.
NetworkExists - check if network exists.
NormalizeCIDR - returns the first address of CIDR.
ParseNetwork - parses a network into a model.
RandomString - returns a random string in a charset.
RemoveAllLegacyNodes - fetches all legacy nodes from DB and removes.
RemoveHost - removes a given host from server.
RemoveHostByID - removes a given host by id from server.
No description provided by the author
RemoveNetworkFromAllocatedIpMap - remove network from allocated ip map when network is deleted.
RemoveStringSlice - removes an element at given index i from a given string slice.
RetrievePrivateTrafficKey - retrieves private key of server.
RetrievePublicTrafficKey - retrieves public key of server.
ReturnErrorResponse - processes error and adds header.
ReturnSuccessResponse - processes message and adds header.
ReturnSuccessResponseWithJson - processes message and adds header.
SaveExtClient - saves an ext client to database.
SaveNetwork - save network struct to database.
SecurityCheck - Check if user has appropriate permissions.
SetAllocatedIpMap - set allocated ip map for networks.
No description provided by the author
SetCorefile - sets the core file of the system.
SetDNS - sets the dns on file.
setFreeTierForTelemetry - store free tier flag without having an import cycle when used for telemetry (as the pro package needs the logic package as currently written).
SetFreeTierLimits - sets limits for free tier.
SetJWTSecret - sets the jwt secret on server startup.
SetNetworkNodesLastModified - sets the network nodes last modified.
SetNodeDefaults - sets the defaults of a node to avoid empty fields.
SetState - sets a state with new expiration.
SetUserDefaults - sets the defaults of a user to avoid empty fields.
SortApiHosts - Sorts slice of ApiHosts by their ID alphabetically with numbers first.
SortApiNodes - Sorts slice of ApiNodes by their ID alphabetically with numbers first.
SortDNSEntrys - Sorts slice of DNSEnteys by their Address alphabetically with numbers first.
SortExtClient - Sorts slice of ExtClients by their ClientID alphabetically with numbers first.
SortNetworks - Sorts slice of Networks by their NetID alphabetically with numbers first.
SortUsers - Sorts slice of Users by username.
StartHookManager - listens on `HookManagerCh` to run any hook.
StoreJWTSecret - stores server jwt secret if needed.
StringDifference - returns the elements in `a` that aren't in `b`.
StringSliceContains - sees if a string slice contains a string element.
TimerCheckpoint - Checks if 24 hours has passed since telemetry was last sent.
ToggleExtClientConnectivity - enables or disables an ext client.
Tokenize - tokenizes an enrollment key to be used via registration and attaches it to the Token field on the struct.
ToReturnUser - gets a user as a return user.
TryToUseEnrollmentKey - checks first if key can be decremented returns true if it is decremented or isvalid.
UniqueAddress - get a unique ipv4 address.
UniqueAddress6 - see if ipv6 address is unique.
UpdateEnrollmentKey - updates an existing enrollment key's associated relay.
UpdateExtClient - updates an ext client with new values.
UpdateHost - updates host data by field.
UpdateHostFromClient - used for updating host on server with update recieved from client.
UpdateHostNetwork - adds/deletes host from a network.
UpdateNetwork - updates a network with another network's fields.
UpdateNode - takes a node and updates another node with it's values.
UpdateNodeCheckin - updates the checkin time of a node.
UpdateUser - updates a given user.
UpsertHost - upserts into DB a given host model, does not check for existence*.
UpsertNode - updates node in the DB.
UpsertUser - updates user in the db.
UserPermissions - checks token stuff.
No description provided by the author
ValidateDNSCreate - checks if an entry is valid.
ValidateDNSUpdate - validates a DNS update.
ValidateEgressGateway - validates the egress gateway model.
No description provided by the author
Validate - validates fields of an network struct.
ValidateNode - validates node values.
No description provided by the author
ValidateUser - validates a user model.
VerifyAuthRequest - verifies an auth request.
VerifyHostToken - [hosts] Only.
VerifyJWT verifies Auth Header.
VerifyUserToken func will used to Verify the JWT Token while using APIS.

# Constants

No description provided by the author
No description provided by the author
KUBERNETES_LISTEN_PORT - starting port for Kubernetes in order to use NodePort range.
KUBERNETES_SERVER_MTU - ideal mtu for kubernetes deployments right now.
No description provided by the author
No description provided by the author
NodePurgeCheckTime is how often to check nodes for Pending Delete.
NodePurgeTime time to wait for node to response to a NODE_DELETE actions.
RELAY_NODE_ERR - error to return if relay node is unfound.
No description provided by the author
No description provided by the author
ZOMBIE_DELETE_TIME - timeout in minutes for zombie node deletion.
ZOMBIE_TIMEOUT - timeout in hours for checking zombie status.

# Variables

No description provided by the author
AllowClientNodeAccess - function to handle removing a node ID from ext client's denied nodes, thus allowing it.
No description provided by the author
CreateFailOver - creates failover in a network.
No description provided by the author
DefaultTrialEndDate - is a placeholder date for not applicable trial end dates.
No description provided by the author
No description provided by the author
No description provided by the author
DenyClientNodeAccess - function to handle adding a node to an ext client's denied node set.
EgressesLimit - dummy var for community.
EnrollmentErrors - struct for holding EnrollmentKey error messages.
EnterpriseCheckFuncs - can be set to run functions for EE.
ErrHostExists error indicating that host exists when trying to create new host.
ErrInvalidHostID.
FailOverExists - check if failover node existed or not.
No description provided by the author
FreeTier - specifies if free tier.
GetAllowedIpForInetNodeClient.
No description provided by the author
GetFailOverPeerIps - gets failover peerips.
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
HookManagerCh - channel to add any new hooks.
IngressesLimit - dummy var for community.
No description provided by the author
IsClientNodeAllowed - function to check if an ext client's denied node set contains a node ID.
No description provided by the author
No description provided by the author
MachinesLimit - dummy var for community.
No description provided by the author
NetworksLimit - dummy var for community.
No description provided by the author
No description provided by the author
ResetFailedOverPeer - removes failed over node from network peers.
ResetFailOver - function to reset failOvered peers on this node.
No description provided by the author
No description provided by the author
SetDefaulGw.
No description provided by the author
SetInternetGw.
No description provided by the author
Pre-Define Permission Templates for default Roles.
UnsetInternetGw.
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
UsersLimit - dummy var for community.
No description provided by the author