Add Route DB model

This commit is contained in:
Juan Font authored and Juan Font committed 2022-11-26 11:21:25 +01:00
1 parent 91559d0558
commit c78403691c
1 file changed
+14
+14
View File
@@ -3,12 +3,26 @@ package headscale
import (
"fmt"
"net/netip"
"gorm.io/gorm"
)
const (
ErrRouteIsNotAvailable = Error("route is not available")
)
type Route struct {
gorm.Model
MachineID uint64
Machine Machine
Prefix IPPrefix
Advertised bool
Enabled bool
IsPrimary bool
}
// Deprecated: use machine function instead
// GetAdvertisedNodeRoutes returns the subnet routes advertised by a node (identified by
// namespace and node name).