model/discovery/Zone.go

32 lines
880 B
Go
Raw Normal View History

2018-08-12 10:46:46 +00:00
package discovery
import (
"sync"
"git.loafle.net/overflow/model/meta"
"git.loafle.net/overflow/model/util"
)
type Zone struct {
2018-09-12 01:55:35 +00:00
MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"`
2018-09-11 07:11:02 +00:00
Network string `json:"network,omitempty"`
Iface string `json:"iface,omitempty"`
Address string `json:"address,omitempty"`
Mac string `json:"mac,omitempty"`
2018-08-12 10:46:46 +00:00
2018-09-11 07:11:02 +00:00
Meta map[string]map[string]string `json:"meta,omitempty"`
DiscoveredBy []string `json:"discoveredBy,omitempty"`
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
2018-08-12 10:46:46 +00:00
mtx sync.RWMutex `json:"-"`
}
2018-09-12 01:55:35 +00:00
func NewZone(metaIPType *meta.MetaIPType, network string, iface string, address string) *Zone {
return &Zone{
MetaIPType: metaIPType,
Network: network,
Iface: iface,
Address: address,
}
}