add initial version

This commit is contained in:
Maycon Santos
2025-07-02 18:08:39 +02:00
parent 6c633497bc
commit 36b6a8e044
12 changed files with 2329 additions and 1142 deletions

View File

@@ -107,6 +107,7 @@ type Route struct {
Enabled bool
Groups []string `gorm:"serializer:json"`
AccessControlGroups []string `gorm:"serializer:json"`
SkipAutoApply bool // If true, this default route will NOT be auto-applied when received from management. Only relevant for default routes (0.0.0.0/0, ::/0).
}
// EventMeta returns activity event meta related to the route
@@ -132,6 +133,7 @@ func (r *Route) Copy() *Route {
Enabled: r.Enabled,
Groups: slices.Clone(r.Groups),
AccessControlGroups: slices.Clone(r.AccessControlGroups),
SkipAutoApply: r.SkipAutoApply,
}
return route
}
@@ -158,7 +160,8 @@ func (r *Route) Equal(other *Route) bool {
other.Enabled == r.Enabled &&
slices.Equal(r.Groups, other.Groups) &&
slices.Equal(r.PeerGroups, other.PeerGroups) &&
slices.Equal(r.AccessControlGroups, other.AccessControlGroups)
slices.Equal(r.AccessControlGroups, other.AccessControlGroups) &&
other.SkipAutoApply == r.SkipAutoApply
}
// IsDynamic returns if the route is dynamic, i.e. has domains