mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-20 20:39:08 +02:00
[management] Add account meta (#3724)
This commit is contained in:
@@ -40,6 +40,17 @@ const (
|
||||
|
||||
type LookupMap map[string]struct{}
|
||||
|
||||
// AccountMeta is a struct that contains a stripped down version of the Account object.
|
||||
// It doesn't carry any peers, groups, policies, or routes, etc. Just some metadata (e.g. ID, created by, created at, etc).
|
||||
type AccountMeta struct {
|
||||
// AccountId is the unique identifier of the account
|
||||
AccountID string `gorm:"column:id"`
|
||||
CreatedAt time.Time
|
||||
CreatedBy string
|
||||
Domain string
|
||||
DomainCategory string
|
||||
}
|
||||
|
||||
// Account represents a unique account of the system
|
||||
type Account struct {
|
||||
// we have to name column to aid as it collides with Network.Id when work with associations
|
||||
@@ -855,6 +866,16 @@ func (a *Account) Copy() *Account {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Account) GetMeta() *AccountMeta {
|
||||
return &AccountMeta{
|
||||
AccountID: a.Id,
|
||||
CreatedBy: a.CreatedBy,
|
||||
CreatedAt: a.CreatedAt,
|
||||
Domain: a.Domain,
|
||||
DomainCategory: a.DomainCategory,
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Account) GetGroupAll() (*Group, error) {
|
||||
for _, g := range a.Groups {
|
||||
if g.Name == "All" {
|
||||
|
||||
Reference in New Issue
Block a user