2023-05-21 19:37:59 +03:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/netip"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
2025-02-26 07:22:55 -08:00
|
|
|
// Deprecated: Approval of routes is denormalised onto the relevant node.
|
|
|
|
// Struct is kept for GORM migrations only.
|
2023-05-21 19:37:59 +03:00
|
|
|
type Route struct {
|
|
|
|
gorm.Model
|
|
|
|
|
2025-01-23 13:40:23 +01:00
|
|
|
NodeID uint64 `gorm:"not null"`
|
2024-12-13 19:15:24 +00:00
|
|
|
Node *Node
|
2023-12-09 18:09:24 +01:00
|
|
|
|
2024-10-02 11:41:58 +02:00
|
|
|
Prefix netip.Prefix `gorm:"serializer:text"`
|
2023-05-21 19:37:59 +03:00
|
|
|
|
2025-02-26 07:22:55 -08:00
|
|
|
// Advertised is now only stored as part of [Node.Hostinfo].
|
2023-05-21 19:37:59 +03:00
|
|
|
Advertised bool
|
|
|
|
|
2025-02-26 07:22:55 -08:00
|
|
|
// Enabled is stored directly on the node as ApprovedRoutes.
|
|
|
|
Enabled bool
|
2023-12-09 18:09:24 +01:00
|
|
|
|
2025-02-26 07:22:55 -08:00
|
|
|
// IsPrimary is only determined in memory as it is only relevant
|
|
|
|
// when the server is up.
|
|
|
|
IsPrimary bool
|
2023-12-09 18:09:24 +01:00
|
|
|
}
|
|
|
|
|
2025-02-26 07:22:55 -08:00
|
|
|
// Deprecated: Approval of routes is denormalised onto the relevant node.
|
|
|
|
type Routes []Route
|