mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-13 08:59:08 +02:00
[management] network map from nmap data type (#6919)
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> Co-authored-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
co-authored by
Dmitri Dolguikh
parent
473392a935
commit
e06c17cf59
@@ -0,0 +1,30 @@
|
||||
package nmdata
|
||||
|
||||
import "slices"
|
||||
|
||||
// GroupAllName is the reserved name of the default group that contains every
|
||||
// peer in an account.
|
||||
const GroupAllName = "All"
|
||||
|
||||
// Group is the slim twin of types.Group.
|
||||
type Group struct {
|
||||
ID string
|
||||
Name string
|
||||
PublicID string
|
||||
Peers []string
|
||||
Resources []Resource
|
||||
}
|
||||
|
||||
func (g *Group) IsGroupAll() bool {
|
||||
return g.Name == GroupAllName
|
||||
}
|
||||
|
||||
func (g *Group) Copy() *Group {
|
||||
return &Group{
|
||||
ID: g.ID,
|
||||
Name: g.Name,
|
||||
PublicID: g.PublicID,
|
||||
Peers: slices.Clone(g.Peers),
|
||||
Resources: slices.Clone(g.Resources),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user