This commit is contained in:
crusader 2018-06-12 22:13:22 +09:00
parent c68381575d
commit ab936be303
50 changed files with 274 additions and 329 deletions

13
.editorconfig Normal file
View File

@ -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

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
}

View File

@ -1,5 +1,5 @@
package member
const (
NG_MEMBER_SERVER_URI ="http://localhost:4200/#"
)
NG_MEMBER_SERVER_URI = "http://localhost:4200/#"
)

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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:"-"`
}

View File

@ -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"`
}

View File

@ -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"`

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}
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"`
}

View File

@ -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"`

View File

@ -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"`
}

View File

@ -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"`
}
}

View File

@ -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"`
}

View File

@ -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,
}
)

View File

@ -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,
}
)

View File

@ -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"`
}

View File

@ -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,
}
)

View File

@ -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,
}

View File

@ -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"`
}
}
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],
}
}

View File

@ -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],
}
}
}

View File

@ -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"`
}

View File

@ -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"`

View File

@ -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"`

View File

@ -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"`

View File

@ -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"`
}

View File

@ -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

View File

@ -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

View File

@ -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"`
}

View File

@ -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

View File

@ -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"`

View File

@ -1,6 +0,0 @@
package noauthprobe
type NoAuthProbeDescription struct {
Host *NoAuthProbeDescriptionHost `json:"host,omitempty"`
Network *NoAuthProbeDescriptionNetwork `json:"network,omitempty"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}

View File

@ -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"`
}