From c78403691cdb3dbc16afba69894387955ab8d512 Mon Sep 17 00:00:00 2001 From: Juan Font Date: Wed, 23 Nov 2022 18:50:30 +0000 Subject: [PATCH] Add Route DB model --- routes.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/routes.go b/routes.go index 676c79b6..079c055c 100644 --- a/routes.go +++ b/routes.go @@ -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).