model/discovery/Host.go

46 lines
1.2 KiB
Go
Raw Normal View History

2018-08-12 10:46:46 +00:00
package discovery
import (
"git.loafle.net/overflow/model/meta"
"git.loafle.net/overflow/model/util"
)
2018-09-12 01:55:35 +00:00
const (
DefaultOsType = "UNKNOWN"
DefaultHostType = "HOST"
DefaultHostVendor = "UNKNOWN"
DefaultHostModel = "UNKNOWN"
)
2018-08-12 10:46:46 +00:00
type Host struct {
2018-09-11 07:11:02 +00:00
MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"`
Name string `json:"name,omitempty"`
Address string `json:"address,omitempty"`
Mac string `json:"mac,omitempty"`
OsType string `json:"osType,omitempty"`
2018-09-12 01:55:35 +00:00
HostType string `json:"hostType,omitempty"`
HostVendor string `json:"hostVendor,omitempty"`
HostModel string `json:"hostModel,omitempty"`
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
Zone *Zone `json:"zone,omitempty"`
PortList []*Port `json:"portList,omitempty"`
}
2018-09-12 01:55:35 +00:00
func NewHost(zone *Zone, metaIPType *meta.MetaIPType, address string) *Host {
return &Host{
Zone: zone,
MetaIPType: metaIPType,
Address: address,
OsType: DefaultOsType,
HostType: DefaultHostType,
HostVendor: DefaultHostVendor,
HostModel: DefaultHostModel,
}
}