diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c685770 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.tabSize": 2, + "editor.insertSpaces": true, +} \ No newline at end of file diff --git a/config/member/uri.go b/config/member/uri.go index 475e289..1c06fe5 100644 --- a/config/member/uri.go +++ b/config/member/uri.go @@ -1,5 +1,5 @@ package member const ( - NG_MEMBER_SERVER_URI ="http://localhost:4200/#" -) \ No newline at end of file + NG_MEMBER_SERVER_URI = "http://localhost:4200/#" +) diff --git a/model/discovery/DiscoverHost.go b/model/discovery/DiscoverHost.go index 95ca7dd..9122298 100644 --- a/model/discovery/DiscoverHost.go +++ b/model/discovery/DiscoverHost.go @@ -1,15 +1,16 @@ package discovery -type DiscoverHost struct { - FirstScanRangeV4 string `json:"firstScanRangev4,omitempty"` - LastScanRangeV4 string `json:"lastScanRangev4,omitempty"` - ExcludeHostsV4 []string `json:"excludeHostsv4,omitempty"` - IncludeHostsV4 []string `json:"includeHostsv4,omitempty"` +import ( + "git.loafle.net/overflow/commons-go/model/meta" +) - FirstScanRangeV6 string `json:"firstScanRangev6,omitempty"` - LastScanRangeV6 string `json:"lastScanRangev6,omitempty"` - ExcludeHostsV6 []string `json:"excludeHostsv6,omitempty"` - IncludeHostsV6 []string `json:"includeHostsv6,omitempty"` +type DiscoverHost struct { + MetaIPType *meta.MetaIPType `json:"metaIpType,omitempty"` + + FirstScanRange string `json:"firstScanRange,omitempty"` + LastScanRange string `json:"lastScanRange,omitempty"` + ExcludeHosts []string `json:"excludeHosts,omitempty"` + IncludeHosts []string `json:"includeHosts,omitempty"` DiscoverPort *DiscoverPort `json:"discoverPort,omitempty"` } diff --git a/model/discovery/Host.go b/model/discovery/Host.go index 95bd928..5608aad 100644 --- a/model/discovery/Host.go +++ b/model/discovery/Host.go @@ -1,24 +1,17 @@ package discovery -import "git.loafle.net/overflow/commons-go/core/util" +import ( + "git.loafle.net/overflow/commons-go/core/util" + "git.loafle.net/overflow/commons-go/model/meta" +) type Host struct { - //Zone *Zone `json:"zone"` - // - //ID json.Number `json:"id,Number,omitempty"` - //IPV4 string `json:"ipv4,omitempty"` - //IPV6 string `json:"ipv6,omitempty"` - //Mac string `json:"mac,omitempty"` - //OS string `json:"os,omitempty"` - // - //DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIpType,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` + + Zone *Zone `json:"zone,omitempty"` + PortList []*Port `json:"portList,omitempty"` - MetaIPTypeKey string `json:"metaIpTypeKey, omitempty"` - Address string `json:"address, omitempty"` - Mac string `json:"mac, omitempty"` - Zone *Zone `json:"zone, omitempty"` - PortList []Port `json:"portList, omitempty"` - DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - } diff --git a/model/discovery/Port.go b/model/discovery/Port.go index dc476b1..e42d5b6 100644 --- a/model/discovery/Port.go +++ b/model/discovery/Port.go @@ -4,27 +4,17 @@ import ( "encoding/json" "git.loafle.net/overflow/commons-go/core/util" + "git.loafle.net/overflow/commons-go/model/meta" "github.com/google/gopacket" ) type Port struct { - MetaPortTypeKey string `json:"metaPortTypeKey,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"` + DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - Host *Host `json:"host,omitempty"` - - ServiceList []Service `json:"serviceList, omitempty"` + Host *Host `json:"host,omitempty"` + ServiceList []*Service `json:"serviceList,omitempty"` UDPLayer gopacket.Layer `json:"-"` - - //Host *Host `json:"host,omitempty"` - // - //ID json.Number `json:"id,Number,omitempty"` - //PortType constants.PortType `json:"portType,omitempty"` - //PortNumber json.Number `json:"portNumber,omitempty"` - // - //DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - // - //UDPLayer gopacket.Layer `json:"-"` } diff --git a/model/discovery/Service.go b/model/discovery/Service.go index fb7315e..2c17ad2 100644 --- a/model/discovery/Service.go +++ b/model/discovery/Service.go @@ -1,21 +1,15 @@ package discovery -import "git.loafle.net/overflow/commons-go/core/util" +import ( + "git.loafle.net/overflow/commons-go/core/util" + "git.loafle.net/overflow/commons-go/model/meta" +) type Service struct { + MetaCryptoTypeKey *meta.MetaCryptoType `json:"metaCryptoType,omitempty"` + Name string `json:"name,omitempty"` - MetaCryptoTypeKey string `json:"metaCryptoTypeKey, omitempty"` - Name string `json:"name, omitempty"` - Port *Port `json:"port, omitempty"` + Port *Port `json:"port,omitempty"` DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - - - //Port *Port `json:"port,omitempty"` - // - //ID json.Number `json:"id,Number,omitempty"` - //CryptoType constants.CryptoType `json:"cryptoType,omitempty"` - //ServiceName string `json:"serviceName,omitempty"` - // - //DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` } diff --git a/model/discovery/Zone.go b/model/discovery/Zone.go index 81011dc..18a28ee 100644 --- a/model/discovery/Zone.go +++ b/model/discovery/Zone.go @@ -1,27 +1,18 @@ package discovery import ( - "git.loafle.net/overflow/commons-go/core/util" "sync" + + "git.loafle.net/overflow/commons-go/core/util" + "git.loafle.net/overflow/commons-go/model/meta" ) type Zone struct { - //ID json.Number `json:"id,Number,omitempty"` - //Network string `json:"network,omitempty"` - //IPV4 string `json:"ipv4,omitempty"` - //IPV6 string `json:"ipv6,omitempty"` - //Iface string `json:"iface,omitempty"` - //Mac string `json:"mac,omitempty"` - // - //DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` - // - //mtx sync.RWMutex `json:"-"` - - Network string `json:"network, omitempty"` - Iface string `json:"iface, omitempty"` - MetaIPTypeKey string `json:"metaIPTypeKey, 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"` DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"` diff --git a/model/infra/Infra.go b/model/infra/Infra.go index 236d0de..ec64e08 100644 --- a/model/infra/Infra.go +++ b/model/infra/Infra.go @@ -11,7 +11,6 @@ import ( type Infra struct { ID json.Number `json:"id,Number,omitempty"` MetaInfraType *meta.MetaInfraType `json:"metaInfraType,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` Probe *probe.Probe `json:"probe,omitempty"` - //Target *target.Target `json:"target,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHost.go b/model/infra/InfraHost.go index aa3e615..6779684 100644 --- a/model/infra/InfraHost.go +++ b/model/infra/InfraHost.go @@ -6,12 +6,12 @@ import ( type InfraHost struct { Infra - InfraZone *InfraZone `json:"infraZone,omitempty"` - MetaTargetHostType *meta.MetaTargetHostType `json:"metaTargetHostType,omitempty"` - InfraHostMachine *InfraHostMachine `json:"infraHostMachine,omitempty"` - InfraHostOS *InfraHostOS `json:"infraHostOS,omitempty"` - InfraHostIPs []InfraHostIP `json:"infraHostIPs,omitempty"` - InfraHostPorts []InfraHostPort `json:"infraHostPorts,omitempty"` - InfraHostApplications []InfraHostApplication `json:"infraHostApplications, omitempty"` - InfraHostDaemons []InfraHostDaemon `json:"infraHostDaemons, omitempty"` + InfraZone *InfraZone `json:"infraZone,omitempty"` + MetaTargetHostType *meta.MetaTargetHostType `json:"metaTargetHostType,omitempty"` + InfraHostMachine *InfraHostMachine `json:"infraHostMachine,omitempty"` + InfraHostOS *InfraHostOS `json:"infraHostOS,omitempty"` + InfraHostIPs []*InfraHostIP `json:"infraHostIPs,omitempty"` + InfraHostPorts []*InfraHostPort `json:"infraHostPorts,omitempty"` + InfraHostApplications []*InfraHostApplication `json:"infraHostApplications,omitempty"` + InfraHostDaemons []*InfraHostDaemon `json:"infraHostDaemons,omitempty"` } diff --git a/model/infra/InfraHostApplication.go b/model/infra/InfraHostApplication.go index 0f99e8f..99d4e1b 100644 --- a/model/infra/InfraHostApplication.go +++ b/model/infra/InfraHostApplication.go @@ -1,14 +1,14 @@ package infra import ( - "git.loafle.net/overflow/commons-go/core/util" "encoding/json" + + "git.loafle.net/overflow/commons-go/core/util" ) type InfraHostApplication struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name, omitempty"` - - InfraHost *InfraHost `json:"infraHost, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHostDaemon.go b/model/infra/InfraHostDaemon.go index ba30404..4beb2be 100644 --- a/model/infra/InfraHostDaemon.go +++ b/model/infra/InfraHostDaemon.go @@ -1,14 +1,14 @@ package infra import ( - "git.loafle.net/overflow/commons-go/core/util" "encoding/json" + + "git.loafle.net/overflow/commons-go/core/util" ) type InfraHostDaemon struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name, omitempty"` - - InfraHost *InfraHost `json:"infraHost, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHostIP.go b/model/infra/InfraHostIP.go index 7716051..c479f60 100644 --- a/model/infra/InfraHostIP.go +++ b/model/infra/InfraHostIP.go @@ -2,17 +2,18 @@ package infra import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/model/meta" ) type InfraHostIP struct { - ID json.Number `json:"id,Number, omitempty"` - InfraHost *InfraHost `json:"infraHost, omitempty"` - MetaIPType *meta.MetaIPType `json:"metaIPType, omitempty"` - Address string `json:"address, omitempty"` - Mac string `json:"mac, omitempty"` - Iface string `json:"iface, omitempty"` - Gateway string `json:"gateway, omitempty"` - CreateDate *util.Timestamp `json:"createDate, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` + Iface string `json:"iface,omitempty"` + Gateway string `json:"gateway,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHostMachine.go b/model/infra/InfraHostMachine.go index 3a22113..3a6ac1e 100644 --- a/model/infra/InfraHostMachine.go +++ b/model/infra/InfraHostMachine.go @@ -1,13 +1,14 @@ package infra import ( - "git.loafle.net/overflow/commons-go/core/util" "encoding/json" + + "git.loafle.net/overflow/commons-go/core/util" ) type InfraHostMachine struct { - ID json.Number `json:"id,Number,omitempty"` - InfraHost *InfraHost `json:"infraHost, omitempty"` - Meta string `json:"meta,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` + ID json.Number `json:"id,Number,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` + Meta string `json:"meta,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHostOS.go b/model/infra/InfraHostOS.go index 04fd3bb..281cc7b 100644 --- a/model/infra/InfraHostOS.go +++ b/model/infra/InfraHostOS.go @@ -1,21 +1,21 @@ package infra import ( - "git.loafle.net/overflow/commons-go/core/util" "encoding/json" + + "git.loafle.net/overflow/commons-go/core/util" ) type InfraHostOS struct { - - ID json.Number `json:"id,Number, omitempty"` - InfraHost *InfraHost `json:"infraHost, omitempty"` - Name string `json:"name, omitempty"` - OS string `json:"os, omitempty"` - Platform string `json:"platform, omitempty"` - PlatformFamily string `json:"platformFamily, omitempty"` - PlatformVersion string `json:"platformVersion, omitempty"` - KernelVersion string `json:"kernelVersion, omitempty"` - HostID string `json:"hostID, omitempty"` - Meta string `json:"meta, omitempty"` - CreateDate *util.Timestamp `json:"createDate, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` + Name string `json:"name,omitempty"` + OS string `json:"os,omitempty"` + Platform string `json:"platform,omitempty"` + PlatformFamily string `json:"platformFamily,omitempty"` + PlatformVersion string `json:"platformVersion,omitempty"` + KernelVersion string `json:"kernelVersion,omitempty"` + HostID string `json:"hostID,omitempty"` + Meta string `json:"meta,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraHostPort.go b/model/infra/InfraHostPort.go index cde394f..584a2d0 100644 --- a/model/infra/InfraHostPort.go +++ b/model/infra/InfraHostPort.go @@ -2,14 +2,15 @@ package infra import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/model/meta" ) type InfraHostPort struct { - ID json.Number `json:"id,Number,omitempty"` - InfraHost *InfraHost `json:"infraHost,omitempty"` - MetaPortType *meta.MetaPortType `json:"metaPortType, omitempty"` - Port json.Number `json:"port,Number,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` + ID json.Number `json:"id,Number,omitempty"` + InfraHost *InfraHost `json:"infraHost,omitempty"` + MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` + Port json.Number `json:"port,Number,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/infra/InfraService.go b/model/infra/InfraService.go index 3fd1978..eab46d7 100644 --- a/model/infra/InfraService.go +++ b/model/infra/InfraService.go @@ -4,8 +4,8 @@ import "git.loafle.net/overflow/commons-go/model/meta" type InfraService struct { Infra - MetaTargetServiceType *meta.MetaTargetServiceType `json:"metaTargetServiceType, omitempty"` - InfraHostIP *InfraHostIP `json:"infraHostIP, omitempty"` - InfraHostPort *InfraHostPort `json:"infraHostPort, omitempty"` - MetaCryptoType *meta.MetaCryptoType `json:"metaCryptoType, omitempty"` + MetaTargetServiceType *meta.MetaTargetServiceType `json:"metaTargetServiceType,omitempty"` + InfraHostIP *InfraHostIP `json:"infraHostIP,omitempty"` + InfraHostPort *InfraHostPort `json:"infraHostPort,omitempty"` + MetaCryptoType *meta.MetaCryptoType `json:"metaCryptoType,omitempty"` } diff --git a/model/infra/InfraZone.go b/model/infra/InfraZone.go index e087996..74f29b6 100644 --- a/model/infra/InfraZone.go +++ b/model/infra/InfraZone.go @@ -4,10 +4,10 @@ import "git.loafle.net/overflow/commons-go/model/meta" type InfraZone struct { Infra - MetaTargetZoneType *meta.MetaTargetZoneType `json:"metaTargetZoneType, omitempty"` - MetaIPType *meta.MetaIPType `json:"metaIPType, omitempty"` - Network string `json:"network, omitempty"` - Iface string `json:"iface, omitempty"` - Address string `json:"address, omitempty"` - Mac string `json:"mac, omitempty"` -} \ No newline at end of file + MetaTargetZoneType *meta.MetaTargetZoneType `json:"metaTargetZoneType,omitempty"` + MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"` + Network string `json:"network,omitempty"` + Iface string `json:"iface,omitempty"` + Address string `json:"address,omitempty"` + Mac string `json:"mac,omitempty"` +} diff --git a/model/member/Member.go b/model/member/Member.go index 3f25e7d..a9fcdb4 100644 --- a/model/member/Member.go +++ b/model/member/Member.go @@ -10,7 +10,7 @@ import ( type Member struct { ID json.Number `json:"id,Number,omitempty"` Email string `json:"email,omitempty"` - Pw string `json:"pw,omitempty"` + Password string `json:"password,omitempty"` Name string `json:"name,omitempty"` Phone string `json:"phone,omitempty"` CompanyName string `json:"companyName,omitempty"` diff --git a/model/meta/MetaCrawler.go b/model/meta/MetaCrawler.go index 47485ba..be7aba3 100644 --- a/model/meta/MetaCrawler.go +++ b/model/meta/MetaCrawler.go @@ -7,10 +7,9 @@ import ( ) type MetaCrawler struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name,omitempty"` - Key string `json:"key,omitempty"` - IsDefault bool `json:"isDefault, omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` - + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` + IsDefault bool `json:"isDefault,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/meta/MetaCryptoType.go b/model/meta/MetaCryptoType.go index dc4565c..0668726 100644 --- a/model/meta/MetaCryptoType.go +++ b/model/meta/MetaCryptoType.go @@ -2,12 +2,13 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaCryptoType struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name, omitempty"` - Key string `json:"key, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` -} \ No newline at end of file +} diff --git a/model/meta/MetaHistoryType.go b/model/meta/MetaHistoryType.go index b7f41ad..c7cc201 100644 --- a/model/meta/MetaHistoryType.go +++ b/model/meta/MetaHistoryType.go @@ -9,6 +9,6 @@ import ( type MetaHistoryType struct { ID json.Number `json:"id,Number,omitempty"` Name string `json:"name,omitempty"` - Key string `json:"key, omitempty"` + Key string `json:"key,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/meta/MetaIPType.go b/model/meta/MetaIPType.go index 369fc53..4b9c50b 100644 --- a/model/meta/MetaIPType.go +++ b/model/meta/MetaIPType.go @@ -2,14 +2,14 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaIPType struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name, omitempty"` - Key string `json:"key, omitempty"` - + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } @@ -21,14 +21,14 @@ const ( ) var ( - metaIPTypeEnumID = map[MetaIPTypeEnum]string { + metaIPTypeEnumID = map[MetaIPTypeEnum]string{ MetaIPTypeEnumV4: "V4", MetaIPTypeEnumV6: "V6", } metaIPTypeEnumKey = map[string]MetaIPTypeEnum{ - "V4": MetaIPTypeEnumV4, - "V6": MetaIPTypeEnumV6, + "V4": MetaIPTypeEnumV4, + "V6": MetaIPTypeEnumV6, } ) diff --git a/model/meta/MetaInfraType.go b/model/meta/MetaInfraType.go index 54d2ef2..01f6616 100644 --- a/model/meta/MetaInfraType.go +++ b/model/meta/MetaInfraType.go @@ -8,7 +8,7 @@ import ( type MetaInfraType struct { ID json.Number `json:"id,Number,omitempty"` - Key string `json:"key, omitempty"` + Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } @@ -16,22 +16,22 @@ type MetaInfraType struct { type MetaInfraTypeEnum int const ( - MetaInfraTypeEnumZONE MetaInfraTypeEnum = 1 - MetaInfraTypeEnumHOST MetaInfraTypeEnum = 2 - MetaInfraTypeEnumService MetaInfraTypeEnum = 3 + MetaInfraTypeEnumZONE MetaInfraTypeEnum = 1 + MetaInfraTypeEnumHOST MetaInfraTypeEnum = 2 + MetaInfraTypeEnumService MetaInfraTypeEnum = 3 ) var ( - metaInfraTypeEnumID = map[MetaInfraTypeEnum]string { - MetaInfraTypeEnumZONE: "ZONE", - MetaInfraTypeEnumHOST: "HOST", - MetaInfraTypeEnumService: "SERVICE", + metaInfraTypeEnumID = map[MetaInfraTypeEnum]string{ + MetaInfraTypeEnumZONE: "ZONE", + MetaInfraTypeEnumHOST: "HOST", + MetaInfraTypeEnumService: "SERVICE", } metaInfraTypeEnumKey = map[string]MetaInfraTypeEnum{ - "ZONE": MetaInfraTypeEnumZONE, - "HOST": MetaInfraTypeEnumHOST, - "SERVICE": MetaInfraTypeEnumService, + "ZONE": MetaInfraTypeEnumZONE, + "HOST": MetaInfraTypeEnumHOST, + "SERVICE": MetaInfraTypeEnumService, } ) diff --git a/model/meta/MetaInfraVendor.go b/model/meta/MetaInfraVendor.go deleted file mode 100644 index 13f8138..0000000 --- a/model/meta/MetaInfraVendor.go +++ /dev/null @@ -1,14 +0,0 @@ -package meta - -import ( - "encoding/json" - - "git.loafle.net/overflow/commons-go/core/util" -) - -type MetaInfraVendor struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` - MetaInfraType *MetaInfraType `json:"metaInfraType,omitempty"` -} diff --git a/model/meta/MetaMemberStatus.go b/model/meta/MetaMemberStatus.go index 866cb9d..0fe8cfe 100644 --- a/model/meta/MetaMemberStatus.go +++ b/model/meta/MetaMemberStatus.go @@ -2,38 +2,39 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaMemberStatus struct { - ID json.Number `json:"id,Number, omitempty"` - Name string `json:"name, omitempty"` - Key string `json:"key, omitempty"` - CreateDate *util.Timestamp `json:"createDate, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } type MetaMemberStatusEnum int const ( MetaMemberStatusEnumNOAUTH MetaMemberStatusEnum = 1 - MetaMemberStatusEnumNORMAL MetaMemberStatusEnum = 2 + MetaMemberStatusEnumNORMAL MetaMemberStatusEnum = 2 MetaMemberStatusEnumDORMANCY MetaMemberStatusEnum = 3 MetaMemberStatusEnumWITHDRAWAL MetaMemberStatusEnum = 4 ) var ( - metaMemberStatusEnumID = map[MetaMemberStatusEnum]string { - MetaMemberStatusEnumNOAUTH: "NOAUTH", - MetaMemberStatusEnumNORMAL: "NORMAL", - MetaMemberStatusEnumDORMANCY: "DORMANCY", + metaMemberStatusEnumID = map[MetaMemberStatusEnum]string{ + MetaMemberStatusEnumNOAUTH: "NOAUTH", + MetaMemberStatusEnumNORMAL: "NORMAL", + MetaMemberStatusEnumDORMANCY: "DORMANCY", MetaMemberStatusEnumWITHDRAWAL: "WITHDRAWAL", } metaMemberStatusEnumKey = map[string]MetaMemberStatusEnum{ - "NOAUTH": MetaMemberStatusEnumNOAUTH, - "NORMAL": MetaMemberStatusEnumNORMAL, - "DORMANCY": MetaMemberStatusEnumDORMANCY, - "WITHDRAWAL":MetaMemberStatusEnumWITHDRAWAL, + "NOAUTH": MetaMemberStatusEnumNOAUTH, + "NORMAL": MetaMemberStatusEnumNORMAL, + "DORMANCY": MetaMemberStatusEnumDORMANCY, + "WITHDRAWAL": MetaMemberStatusEnumWITHDRAWAL, } ) diff --git a/model/meta/MetaNoAuthProbeStatus.go b/model/meta/MetaNoAuthProbeStatus.go index eaee1e1..a39db6c 100644 --- a/model/meta/MetaNoAuthProbeStatus.go +++ b/model/meta/MetaNoAuthProbeStatus.go @@ -2,12 +2,13 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaNoAuthProbeStatus struct { ID json.Number `json:"id,Number,omitempty"` - Key string `json:"key, omitempty"` + Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } @@ -15,20 +16,20 @@ type MetaNoAuthProbeStatus struct { type NoAuthProbeStatusEnum int const ( - NoAuthProbeStatusEnumACCEPT NoAuthProbeStatusEnum = 1 - NoAuthProbeStatusEnumDENY NoAuthProbeStatusEnum = 2 + NoAuthProbeStatusEnumACCEPT NoAuthProbeStatusEnum = 1 + NoAuthProbeStatusEnumDENY NoAuthProbeStatusEnum = 2 NoAuthProbeStatusEnumPROCESSING NoAuthProbeStatusEnum = 3 ) var ( noAuthProbeStatusEnumID = map[NoAuthProbeStatusEnum]string{ - NoAuthProbeStatusEnumACCEPT: "ACCEPT", - NoAuthProbeStatusEnumDENY: "DENY", - NoAuthProbeStatusEnumPROCESSING:"PROCESSING", + NoAuthProbeStatusEnumACCEPT: "ACCEPT", + NoAuthProbeStatusEnumDENY: "DENY", + NoAuthProbeStatusEnumPROCESSING: "PROCESSING", } noAuthProbeStatusEnumKey = map[string]NoAuthProbeStatusEnum{ - "ACCEPT": NoAuthProbeStatusEnumACCEPT, + "ACCEPT": NoAuthProbeStatusEnumACCEPT, "DENY": NoAuthProbeStatusEnumDENY, "PROCESSING": NoAuthProbeStatusEnumPROCESSING, } diff --git a/model/meta/MetaPortType.go b/model/meta/MetaPortType.go index 34e3128..a4edbc6 100644 --- a/model/meta/MetaPortType.go +++ b/model/meta/MetaPortType.go @@ -2,12 +2,42 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaPortType struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name, omitempty"` - Key string `json:"key, omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` -} \ No newline at end of file +} + +type MetaPortTypeEnum int + +const ( + MetaPortTypeEnumTCP MetaPortTypeEnum = 1 + MetaPortTypeEnumUDP MetaPortTypeEnum = 2 +) + +var ( + metaPortTypeEnumID = map[MetaPortTypeEnum]string{ + MetaPortTypeEnumTCP: "TCP", + MetaPortTypeEnumUDP: "UDP", + } + + metaPortTypeEnumKey = map[string]MetaPortTypeEnum{ + "TCP": MetaPortTypeEnumTCP, + "UDP": MetaPortTypeEnumUDP, + } +) + +func ToMetaPortTypeEnum(v *MetaPortType) MetaPortTypeEnum { + return metaPortTypeEnumKey[v.Key] +} + +func ToMetaPortType(v MetaPortTypeEnum) *MetaPortType { + return &MetaPortType{ + Key: metaPortTypeEnumID[v], + } +} diff --git a/model/meta/MetaProbeStatus.go b/model/meta/MetaProbeStatus.go index 609bd57..471bb0a 100644 --- a/model/meta/MetaProbeStatus.go +++ b/model/meta/MetaProbeStatus.go @@ -2,14 +2,14 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaProbeStatus struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name,omitempty"` - Key string `json:"key, omitempty"` - + ID json.Number `json:"id,Number,omitempty"` + Name string `json:"name,omitempty"` + Key string `json:"key,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } @@ -21,14 +21,14 @@ const ( ) var ( - metaProbeStatusEnumID = map[MetaProbeStatusEnum]string { + metaProbeStatusEnumID = map[MetaProbeStatusEnum]string{ MetaProbeStatusEnumINITIAL: "INITIAL", MetaProbeStatusEnumNORMAL: "NORMAL", } metaProbeStatusEnumKey = map[string]MetaProbeStatusEnum{ - "INITIAL": MetaProbeStatusEnumINITIAL, - "NORMAL": MetaProbeStatusEnumNORMAL, + "INITIAL": MetaProbeStatusEnumINITIAL, + "NORMAL": MetaProbeStatusEnumNORMAL, } ) @@ -40,4 +40,4 @@ func ToMetaProbeStatus(v MetaProbeStatusEnum) *MetaProbeStatus { return &MetaProbeStatus{ Key: metaProbeStatusEnumID[v], } -} \ No newline at end of file +} diff --git a/model/meta/MetaProbeTaskType.go b/model/meta/MetaProbeTaskType.go deleted file mode 100644 index 8b50c9d..0000000 --- a/model/meta/MetaProbeTaskType.go +++ /dev/null @@ -1,14 +0,0 @@ -package meta - -import ( - "encoding/json" - - "git.loafle.net/overflow/commons-go/core/util" -) - -type MetaProbeTaskType struct { - ID json.Number `json:"id,Number,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` -} diff --git a/model/meta/MetaSensorDisplayItem.go b/model/meta/MetaSensorDisplayItem.go index f80a045..9b05c3b 100644 --- a/model/meta/MetaSensorDisplayItem.go +++ b/model/meta/MetaSensorDisplayItem.go @@ -8,9 +8,9 @@ import ( type MetaSensorDisplayItem struct { ID json.Number `json:"id,Number,omitempty"` - Key string `json:"key, omitempty"` + Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` - IsDefault bool `json:"isDefault,omitempty"` + IsDefault bool `json:"isDefault,omitempty"` MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"` MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"` MetaSensorItemType *MetaSensorItemType `json:"metaSensorItemType,omitempty"` diff --git a/model/meta/MetaSensorItemKey.go b/model/meta/MetaSensorItemKey.go index 7903246..5f3d3e2 100644 --- a/model/meta/MetaSensorItemKey.go +++ b/model/meta/MetaSensorItemKey.go @@ -9,7 +9,7 @@ import ( type MetaSensorItemKey struct { ID json.Number `json:"id,Number,omitempty"` Key string `json:"key,omitempty"` - Name string `json:"name, omitempty"` + Name string `json:"name,omitempty"` Froms string `json:"froms,omitempty"` Option string `json:"option,omitempty"` MetaSensorItem *MetaSensorItem `json:"metaSensorItem,omitempty"` diff --git a/model/meta/MetaSensorItemUnit.go b/model/meta/MetaSensorItemUnit.go index bfd4201..a14d001 100644 --- a/model/meta/MetaSensorItemUnit.go +++ b/model/meta/MetaSensorItemUnit.go @@ -8,7 +8,7 @@ import ( type MetaSensorItemUnit struct { ID json.Number `json:"id,Number,omitempty"` - Key string `json:"key, omitempty"` + Key string `json:"key,omitempty"` Unit string `json:"unit,omitempty"` Mark string `json:"mark,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` diff --git a/model/meta/MetaSensorStatus.go b/model/meta/MetaSensorStatus.go index d154490..3e25bca 100644 --- a/model/meta/MetaSensorStatus.go +++ b/model/meta/MetaSensorStatus.go @@ -2,12 +2,13 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" ) type MetaSensorStatus struct { - ID json.Number `json:"id,Number,omitempty"` - Key string `json:"key, omitempty"` - Name string `json:"name,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Key string `json:"key,omitempty"` + Name string `json:"name,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/meta/MetaTargetHostType.go b/model/meta/MetaTargetHostType.go index a810f6f..65332b2 100644 --- a/model/meta/MetaTargetHostType.go +++ b/model/meta/MetaTargetHostType.go @@ -7,16 +7,16 @@ type MetaTargetHostType struct { type MetaTargetHostTypeEnum int const ( - MetaTargetHostTypeEnumUNKNOWN MetaTargetHostTypeEnum = 100 + MetaTargetHostTypeEnumUNKNOWN MetaTargetHostTypeEnum = 100 ) var ( metaTargetHostTypeEnumID = map[MetaTargetHostTypeEnum]string{ - MetaTargetHostTypeEnumUNKNOWN: "UNKNOWN", + MetaTargetHostTypeEnumUNKNOWN: "UNKNOWN", } metaTargetHostTypeEnumKey = map[string]MetaTargetHostTypeEnum{ - "UNKNOWN": MetaTargetHostTypeEnumUNKNOWN, + "UNKNOWN": MetaTargetHostTypeEnumUNKNOWN, } ) @@ -25,8 +25,7 @@ func ToMetaTargetHostTypeEnum(v *MetaTargetHostType) MetaTargetHostTypeEnum { } func ToMetaTargetHostType(v MetaTargetHostTypeEnum) *MetaTargetHostType { - m := &MetaTargetHostType { - } + m := &MetaTargetHostType{} m.Key = metaTargetHostTypeEnumID[v] return m diff --git a/model/meta/MetaTargetServiceType.go b/model/meta/MetaTargetServiceType.go index f16a8c7..78a3735 100644 --- a/model/meta/MetaTargetServiceType.go +++ b/model/meta/MetaTargetServiceType.go @@ -7,16 +7,16 @@ type MetaTargetServiceType struct { type MetaTargetServiceTypeEnum int const ( - MetaTargetServiceTypeEnumUNKNOWN MetaTargetServiceTypeEnum = 1000 + MetaTargetServiceTypeEnumUNKNOWN MetaTargetServiceTypeEnum = 1000 ) var ( metaTargetServiceTypeEnumID = map[MetaTargetServiceTypeEnum]string{ - MetaTargetServiceTypeEnumUNKNOWN: "UNKNOWN", + MetaTargetServiceTypeEnumUNKNOWN: "UNKNOWN", } metaTargetServiceTypeEnumKey = map[string]MetaTargetServiceTypeEnum{ - "UNKNOWN": MetaTargetServiceTypeEnumUNKNOWN, + "UNKNOWN": MetaTargetServiceTypeEnumUNKNOWN, } ) @@ -25,8 +25,7 @@ func ToMetaTargetServiceTypeEnum(v *MetaTargetServiceType) MetaTargetServiceType } func ToMetaTargetServiceType(v MetaTargetServiceTypeEnum) *MetaTargetServiceType { - m := &MetaTargetServiceType { - } + m := &MetaTargetServiceType{} m.Key = metaTargetServiceTypeEnumID[v] return m diff --git a/model/meta/MetaTargetType.go b/model/meta/MetaTargetType.go index a3c1116..42c43c0 100644 --- a/model/meta/MetaTargetType.go +++ b/model/meta/MetaTargetType.go @@ -2,16 +2,15 @@ package meta import ( "encoding/json" + "git.loafle.net/overflow/commons-go/core/util" - "git.loafle.net/overflow_backup_2018_0455/overflow_service/proxy/meta" ) type MetaTargetType struct { - ID json.Number `json:"id, Number, omitempty"` - MetaInfraType *meta.MetaInfraType `json:"metaInfraType, omitempty"` - Key string `json:"key, omitempty"` - Name string `json:"name, omitempty"` - IsSupported bool `json:"isSupported, omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` - + ID json.Number `json:"id,Number,omitempty"` + MetaInfraType *MetaInfraType `json:"metaInfraType,omitempty"` + Key string `json:"key,omitempty"` + Name string `json:"name,omitempty"` + IsSupported bool `json:"isSupported,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/meta/MetaTargetZoneType.go b/model/meta/MetaTargetZoneType.go index fe3b69b..af30a39 100644 --- a/model/meta/MetaTargetZoneType.go +++ b/model/meta/MetaTargetZoneType.go @@ -5,19 +5,20 @@ type MetaTargetZoneType struct { } type MetaTargetZoneTypeEnum int + const ( - MetaTargetZoneTypeEnumUNKNOWN MetaTargetZoneTypeEnum = 1 - MetaTargetZoneTypeEnumZONE MetaTargetZoneTypeEnum = 2 + MetaTargetZoneTypeEnumUNKNOWN MetaTargetZoneTypeEnum = 1 + MetaTargetZoneTypeEnumZONE MetaTargetZoneTypeEnum = 2 ) var ( metaTargetZoneTypeEnumID = map[MetaTargetZoneTypeEnum]string{ - MetaTargetZoneTypeEnumUNKNOWN: "UNKNOWN", - MetaTargetZoneTypeEnumZONE: "ZONE", + MetaTargetZoneTypeEnumUNKNOWN: "UNKNOWN", + MetaTargetZoneTypeEnumZONE: "ZONE", } metaTargetZoneTypeEnumKey = map[string]MetaTargetZoneTypeEnum{ - "UNKNOWN": MetaTargetZoneTypeEnumUNKNOWN, + "UNKNOWN": MetaTargetZoneTypeEnumUNKNOWN, "ZONE": MetaTargetZoneTypeEnumZONE, } ) @@ -27,8 +28,7 @@ func ToMetaTargetZoneTypeEnum(v *MetaTargetZoneType) MetaTargetZoneTypeEnum { } func ToMetaTargetZoneType(v MetaTargetZoneTypeEnum) *MetaTargetZoneType { - m := &MetaTargetZoneType { - } + m := &MetaTargetZoneType{} m.Key = metaTargetZoneTypeEnumID[v] return m diff --git a/model/noauthprobe/NoAuthProbe.go b/model/noauthprobe/NoAuthProbe.go index f2b9e07..35b1a8d 100644 --- a/model/noauthprobe/NoAuthProbe.go +++ b/model/noauthprobe/NoAuthProbe.go @@ -4,17 +4,17 @@ import ( "encoding/json" "git.loafle.net/overflow/commons-go/core/util" - "git.loafle.net/overflow/commons-go/model/meta" "git.loafle.net/overflow/commons-go/model/domain" + "git.loafle.net/overflow/commons-go/model/meta" "git.loafle.net/overflow/commons-go/model/probe" ) type NoAuthProbe struct { ID json.Number `json:"id,Number,omitempty"` - Domain *domain.DomainMember `json:"domain,omitempty"` + Domain *domain.Domain `json:"domain,omitempty"` Probe *probe.Probe `json:"probe,omitempty"` MetaNoAuthProbeStatus *meta.MetaNoAuthProbeStatus `json:"metaNoAuthProbeStatus,omitempty"` - InfraHostMeta string `json:"infraHostMeta, omitempty"` + InfraHostMeta string `json:"infraHostMeta,omitempty"` TempProbeKey string `json:"tempProbeKey,omitempty"` APIKey string `json:"apiKey,omitempty"` ConnectDate *util.Timestamp `json:"connectDate,omitempty"` diff --git a/model/noauthprobe/NoAuthProbeDescription.go b/model/noauthprobe/NoAuthProbeDescription.go deleted file mode 100644 index 6727de7..0000000 --- a/model/noauthprobe/NoAuthProbeDescription.go +++ /dev/null @@ -1,6 +0,0 @@ -package noauthprobe - -type NoAuthProbeDescription struct { - Host *NoAuthProbeDescriptionHost `json:"host,omitempty"` - Network *NoAuthProbeDescriptionNetwork `json:"network,omitempty"` -} diff --git a/model/noauthprobe/NoAuthProbeDescriptionHost.go b/model/noauthprobe/NoAuthProbeDescriptionHost.go deleted file mode 100644 index 67d6b6d..0000000 --- a/model/noauthprobe/NoAuthProbeDescriptionHost.go +++ /dev/null @@ -1,11 +0,0 @@ -package noauthprobe - -type NoAuthProbeDescriptionHost struct { - Name string `json:"name,omitempty"` - OS string `json:"os,omitempty"` - Platform string `json:"paltform,omitempty"` - PlatformFamily string `json:"platformFamily,omitempty"` - PlatformVersion string `json:"platformVersion,omitempty"` - KernelVersion string `json:"kernelVersion,omitempty"` - HostID string `json:"hostID,omitempty"` -} diff --git a/model/noauthprobe/NoAuthProbeDescriptionNetwork.go b/model/noauthprobe/NoAuthProbeDescriptionNetwork.go deleted file mode 100644 index 68a4bcc..0000000 --- a/model/noauthprobe/NoAuthProbeDescriptionNetwork.go +++ /dev/null @@ -1,8 +0,0 @@ -package noauthprobe - -type NoAuthProbeDescriptionNetwork struct { - Name string `json:"name,omitempty"` - Address string `json:"address,omitempty"` - Gateway string `json:"gateway,omitempty"` - MacAddress string `json:"macAddress,omitempty"` -} diff --git a/model/notification/Notification.go b/model/notification/Notification.go index eb7e8a7..4537006 100644 --- a/model/notification/Notification.go +++ b/model/notification/Notification.go @@ -9,10 +9,10 @@ import ( type Notification struct { ID json.Number `json:"id,Number,omitempty"` - CreateDate *util.Timestamp `json:"date,omitempty"` Title string `json:"title,omitempty"` Message string `json:"message,omitempty"` Member *member.Member `json:"member,omitempty"` + URL string `json:"url,omitempty"` ConfirmDate *util.Timestamp `json:"confirmDate,omitempty"` - Url string `json:"url,omitempty"` + CreateDate *util.Timestamp `json:"date,omitempty"` } diff --git a/model/probe/Probe.go b/model/probe/Probe.go index 719d4a4..38e4058 100644 --- a/model/probe/Probe.go +++ b/model/probe/Probe.go @@ -4,9 +4,9 @@ import ( "encoding/json" "git.loafle.net/overflow/commons-go/core/util" - "git.loafle.net/overflow/commons-go/model/meta" "git.loafle.net/overflow/commons-go/model/domain" "git.loafle.net/overflow/commons-go/model/member" + "git.loafle.net/overflow/commons-go/model/meta" ) type Probe struct { @@ -20,8 +20,8 @@ type Probe struct { Cidr string `json:"cidr,omitempty"` AuthorizeDate *util.Timestamp `json:"authorizeDate,omitempty"` AuthorizeMember *member.Member `json:"authorizeMember,omitempty"` - TargetCount int `json:"targetCount,omitempty"` - ConnectDate *util.Timestamp `json:"connectDate,omitempty"` + TargetCount int `json:"targetCount,omitempty"` ConnectAddress string `json:"connectAddress,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` + ConnectDate *util.Timestamp `json:"connectDate,omitempty"` } diff --git a/model/probe/ProbeTask.go b/model/probe/ProbeTask.go deleted file mode 100644 index e38010d..0000000 --- a/model/probe/ProbeTask.go +++ /dev/null @@ -1,20 +0,0 @@ -package probe - -import ( - "encoding/json" - - "git.loafle.net/overflow/commons-go/core/util" - "git.loafle.net/overflow/commons-go/model/meta" -) - -type ProbeTask struct { - ID json.Number `json:"id,Number,omitempty"` - MetaProbeTaskType *meta.MetaProbeTaskType `json:"metaProbeTaskType,omitempty"` - Probe *Probe `json:"probe,omitempty"` - Data string `json:"data,omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` - SendDate *util.Timestamp `json:"sendDate,omitempty"` - StartDate *util.Timestamp `json:"startDate,omitempty"` - EndDate *util.Timestamp `json:"endDate,omitempty"` - Succeed bool `json:"succeed,omitempty"` -} diff --git a/model/sensor/Sensor.go b/model/sensor/Sensor.go index 5d5fb9c..383f716 100644 --- a/model/sensor/Sensor.go +++ b/model/sensor/Sensor.go @@ -10,12 +10,12 @@ import ( type Sensor struct { ID json.Number `json:"id,Number,omitempty"` - Target *target.Target `json:"target, omitempty"` - Name string `json:"name, omitempty"` + Target *target.Target `json:"target,omitempty"` + Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` MetaSensorStatus *meta.MetaSensorStatus `json:"metaSensorStatus,omitempty"` MetaCrawler *meta.MetaCrawler `json:"metaCrawler,omitempty"` CrawlerInputItems string `json:"crawlerInputItems,omitempty"` - ItemCount json.Number `json:"itemCount,omitempty"` + ItemCount json.Number `json:"itemCount,omitempty"` CreateDate *util.Timestamp `json:"createDate,omitempty"` } diff --git a/model/sensorconfig/Connection.go b/model/sensorconfig/Connection.go index 3aa7172..64f7710 100644 --- a/model/sensorconfig/Connection.go +++ b/model/sensorconfig/Connection.go @@ -7,8 +7,8 @@ import ( ) type Connection struct { - IP string `json:"ip,omitempty"` - Port json.Number `json:"port,Number,omitempty"` - MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` - SSL bool `json:"ssl,omitempty"` + IP string `json:"ip,omitempty"` + Port json.Number `json:"port,Number,omitempty"` + MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"` + MetaCryptoType *meta.MetaCryptoType `json:"metaCryptoType,omitempty"` } diff --git a/model/sensorconfig/Item.go b/model/sensorconfig/Item.go index 5bfb7bc..e7aff99 100644 --- a/model/sensorconfig/Item.go +++ b/model/sensorconfig/Item.go @@ -1,7 +1,7 @@ package sensorconfig type Item struct { - Keys []Keys `json:"keys,omitempty"` + Keys []*Keys `json:"keys,omitempty"` QueryInfo *QueryInfo `json:"queryInfo,omitempty"` MappingInfo *MappingInfo `json:"mappingInfo,omitempty"` } diff --git a/model/sensorconfig/SensorConfig.go b/model/sensorconfig/SensorConfig.go index 119ddbc..3ce848c 100644 --- a/model/sensorconfig/SensorConfig.go +++ b/model/sensorconfig/SensorConfig.go @@ -8,5 +8,5 @@ type SensorConfig struct { Target *Target `json:"target,omitempty"` Schedule *Schedule `json:"schedule,omitempty"` Crawler *Crawler `json:"crawler,omitempty"` - Items []Item `json:"items,omitempty"` + Items []*Item `json:"items,omitempty"` } diff --git a/model/target/Target.go b/model/target/Target.go index 15be5a5..89c397b 100644 --- a/model/target/Target.go +++ b/model/target/Target.go @@ -10,12 +10,12 @@ import ( ) type Target struct { - ID json.Number `json:"id,Number,omitempty"` - Infra *infra.Infra `json:"infra, omitempty"` - MetaTargetType *meta.MetaTargetType `json:"metaTargetType, omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - SensorCount json.Number `json:"sensorCount, omitempty"` - CreateDate *util.Timestamp `json:"createDate,omitempty"` - Sensors []sensor.Sensor `json:"sensors,omitempty"` + ID json.Number `json:"id,Number,omitempty"` + Infra *infra.Infra `json:"infra,omitempty"` + MetaTargetType *meta.MetaTargetType `json:"metaTargetType,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + SensorCount json.Number `json:"sensorCount,omitempty"` + CreateDate *util.Timestamp `json:"createDate,omitempty"` + Sensors []*sensor.Sensor `json:"sensors,omitempty"` }