mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-21 23:47:34 +00:00
Minor linting issues
This commit is contained in:
parent
d86de68b40
commit
7287e0259c
@ -97,7 +97,7 @@ func (h *Headscale) ListMachinesInNamespace(name string) (*[]Machine, error) {
|
||||
return &machines, nil
|
||||
}
|
||||
|
||||
// ListSharedMachinesInNamespaces returns all the machines that are shared to the specified namespace
|
||||
// ListSharedMachinesInNamespace returns all the machines that are shared to the specified namespace
|
||||
func (h *Headscale) ListSharedMachinesInNamespace(name string) (*[]Machine, error) {
|
||||
n, err := h.GetNamespace(name)
|
||||
if err != nil {
|
||||
|
@ -56,6 +56,7 @@ func (h *Headscale) GetEnabledNodeRoutes(namespace string, nodeName string) ([]n
|
||||
return routes, nil
|
||||
}
|
||||
|
||||
// IsNodeRouteEnabled checks if a certain route has been enabled
|
||||
func (h *Headscale) IsNodeRouteEnabled(namespace string, nodeName string, routeStr string) bool {
|
||||
route, err := netaddr.ParseIPPrefix(routeStr)
|
||||
if err != nil {
|
||||
@ -129,6 +130,7 @@ func (h *Headscale) EnableNodeRoute(namespace string, nodeName string, routeStr
|
||||
return nil
|
||||
}
|
||||
|
||||
// RoutesToPtables converts the list of routes to a nice table
|
||||
func (h *Headscale) RoutesToPtables(namespace string, nodeName string, availableRoutes []netaddr.IPPrefix) pterm.TableData {
|
||||
d := pterm.TableData{{"Route", "Enabled"}}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import "gorm.io/gorm"
|
||||
const errorSameNamespace = Error("Destination namespace same as origin")
|
||||
const errorNodeAlreadyShared = Error("Node already shared to this namespace")
|
||||
|
||||
// Sharing is a join table to support sharing nodes between namespaces
|
||||
// SharedNode is a join table to support sharing nodes between namespaces
|
||||
type SharedNode struct {
|
||||
gorm.Model
|
||||
MachineID uint64
|
||||
|
Loading…
x
Reference in New Issue
Block a user