From 21bc8700b6ac92f399e91717bb371ed75b5bc8c1 Mon Sep 17 00:00:00 2001 From: crusader Date: Tue, 28 Aug 2018 19:42:07 +0900 Subject: [PATCH] meta added --- discovery/Host.go | 7 ++++--- discovery/Port.go | 8 +++++--- discovery/Service.go | 1 + discovery/Zone.go | 11 ++++++----- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/discovery/Host.go b/discovery/Host.go index d92d8d0..777a57a 100644 --- a/discovery/Host.go +++ b/discovery/Host.go @@ -6,9 +6,10 @@ import ( ) type Host struct { - MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` - Address string `json:"address,omitempty"` - Mac string `json:"mac,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` + Meta map[string]string `json:"meta,omitempty"` Zone *Zone `json:"zone,omitempty"` PortList []*Port `json:"portList,omitempty"` diff --git a/discovery/Port.go b/discovery/Port.go index f25df95..379e0b8 100644 --- a/discovery/Port.go +++ b/discovery/Port.go @@ -9,9 +9,11 @@ import ( ) type Port struct { - MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` - PortNumber json.Number `json:"portNumber,omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` + MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` + PortNumber json.Number `json:"portNumber,omitempty"` + Meta map[string]string `json:"meta,omitempty"` + + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` Host *Host `json:"host,omitempty"` ServiceList []*Service `json:"serviceList,omitempty"` diff --git a/discovery/Service.go b/discovery/Service.go index c0b03ea..bd3ed9d 100644 --- a/discovery/Service.go +++ b/discovery/Service.go @@ -10,6 +10,7 @@ type Service struct { Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` + Meta map[string]string `json:"meta,omitempty"` Port *Port `json:"port,omitempty"` diff --git a/discovery/Zone.go b/discovery/Zone.go index 4033b18..54fbe0f 100644 --- a/discovery/Zone.go +++ b/discovery/Zone.go @@ -8,11 +8,12 @@ import ( ) type Zone struct { - Network string `json:"network,omitempty"` - Iface string `json:"iface,omitempty"` - MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` - Address string `json:"address,omitempty"` - Mac string `json:"mac,omitempty"` + Network string `json:"network,omitempty"` + Iface string `json:"iface,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` + Meta map[string]string `json:"meta,omitempty"` DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`