ing
This commit is contained in:
parent
b65ef6017d
commit
e0caf04f92
|
@ -1,19 +1,24 @@
|
||||||
package discovery
|
package discovery
|
||||||
|
|
||||||
import (
|
import "git.loafle.net/overflow/commons-go/core/util"
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Host struct {
|
type Host struct {
|
||||||
Zone *Zone `json:"zone"`
|
//Zone *Zone `json:"zone"`
|
||||||
|
//
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
//ID json.Number `json:"id,Number,omitempty"`
|
||||||
IPV4 string `json:"ipv4,omitempty"`
|
//IPV4 string `json:"ipv4,omitempty"`
|
||||||
IPV6 string `json:"ipv6,omitempty"`
|
//IPV6 string `json:"ipv6,omitempty"`
|
||||||
Mac string `json:"mac,omitempty"`
|
//Mac string `json:"mac,omitempty"`
|
||||||
OS string `json:"os,omitempty"`
|
//OS string `json:"os,omitempty"`
|
||||||
|
//
|
||||||
|
//DiscoveredDate *util.Timestamp `json:"discoveredDate,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"`
|
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,28 @@ package discovery
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/google/gopacket"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/constants"
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"github.com/google/gopacket"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Port struct {
|
type Port struct {
|
||||||
|
MetaPortTypeKey string `json:"metaPortTypeKey,omitempty"`
|
||||||
|
PortNumber json.Number `json:"portNumber, omitempty"`
|
||||||
|
DiscoveredDate *util.Timestamp `json:"discoveredDate, omitempty"`
|
||||||
|
|
||||||
Host *Host `json:"host,omitempty"`
|
Host *Host `json:"host,omitempty"`
|
||||||
|
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ServiceList []Service `json:"serviceList, omitempty"`
|
||||||
PortType constants.PortType `json:"portType,omitempty"`
|
|
||||||
PortNumber json.Number `json:"portNumber,omitempty"`
|
|
||||||
|
|
||||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
|
||||||
|
|
||||||
UDPLayer gopacket.Layer `json:"-"`
|
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:"-"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,21 @@
|
||||||
package discovery
|
package discovery
|
||||||
|
|
||||||
import (
|
import "git.loafle.net/overflow/commons-go/core/util"
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/constants"
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Service struct {
|
type Service struct {
|
||||||
Port *Port `json:"port,omitempty"`
|
|
||||||
|
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
MetaCryptoTypeKey string `json:"metaCryptoTypeKey, omitempty"`
|
||||||
CryptoType constants.CryptoType `json:"cryptoType,omitempty"`
|
Name string `json:"name, omitempty"`
|
||||||
ServiceName string `json:"serviceName,omitempty"`
|
Port *Port `json:"port, omitempty"`
|
||||||
|
|
||||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,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"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
package discovery
|
package discovery
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"sync"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Zone struct {
|
type Zone struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
//ID json.Number `json:"id,Number,omitempty"`
|
||||||
Network string `json:"network,omitempty"`
|
//Network string `json:"network,omitempty"`
|
||||||
IPV4 string `json:"ipv4,omitempty"`
|
//IPV4 string `json:"ipv4,omitempty"`
|
||||||
IPV6 string `json:"ipv6,omitempty"`
|
//IPV6 string `json:"ipv6,omitempty"`
|
||||||
Iface string `json:"iface,omitempty"`
|
//Iface string `json:"iface,omitempty"`
|
||||||
Mac string `json:"mac,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"`
|
||||||
|
|
||||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
"git.loafle.net/overflow/commons-go/model/meta"
|
||||||
"git.loafle.net/overflow/commons-go/model/probe"
|
"git.loafle.net/overflow/commons-go/model/probe"
|
||||||
"git.loafle.net/overflow/commons-go/model/target"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Infra struct {
|
type Infra struct {
|
||||||
|
@ -14,5 +13,5 @@ type Infra struct {
|
||||||
MetaInfraType *meta.MetaInfraType `json:"metaInfraType,omitempty"`
|
MetaInfraType *meta.MetaInfraType `json:"metaInfraType,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
Probe *probe.Probe `json:"probe,omitempty"`
|
Probe *probe.Probe `json:"probe,omitempty"`
|
||||||
Target *target.Target `json:"target,omitempty"`
|
//Target *target.Target `json:"target,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package infra
|
package infra
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/model/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InfraHost struct {
|
type InfraHost struct {
|
||||||
Infra
|
Infra
|
||||||
InfraOS *InfraOS `json:"infraOS,omitempty"`
|
InfraZone *InfraZone `json:"infraZone,omitempty"`
|
||||||
IP string `json:"ip,omitempty"`
|
MetaTargetHostType *meta.MetaTargetHostType `json:"metaTargetHostType,omitempty"`
|
||||||
Mac string `json:"mac,omitempty"`
|
InfraHostMachine *InfraHostMachine `json:"infraHostMachine,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,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"`
|
||||||
}
|
}
|
||||||
|
|
14
model/infra/InfraHostApplication.go
Normal file
14
model/infra/InfraHostApplication.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
type InfraHostApplication struct {
|
||||||
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
|
Name string `json:"name, omitempty"`
|
||||||
|
|
||||||
|
InfraHost *InfraHost `json:"infraHost, omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
}
|
14
model/infra/InfraHostDaemon.go
Normal file
14
model/infra/InfraHostDaemon.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
type InfraHostDaemon struct {
|
||||||
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
|
Name string `json:"name, omitempty"`
|
||||||
|
|
||||||
|
InfraHost *InfraHost `json:"infraHost, omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
}
|
18
model/infra/InfraHostIP.go
Normal file
18
model/infra/InfraHostIP.go
Normal file
|
@ -0,0 +1,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"`
|
||||||
|
}
|
13
model/infra/InfraHostMachine.go
Normal file
13
model/infra/InfraHostMachine.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
21
model/infra/InfraHostOS.go
Normal file
21
model/infra/InfraHostOS.go
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"encoding/json"
|
||||||
|
)
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
15
model/infra/InfraHostPort.go
Normal file
15
model/infra/InfraHostPort.go
Normal file
|
@ -0,0 +1,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"`
|
||||||
|
}
|
|
@ -1,9 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import "git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
|
|
||||||
type InfraMachine struct {
|
|
||||||
Infra
|
|
||||||
Meta string `json:"meta,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import (
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
|
||||||
)
|
|
||||||
|
|
||||||
type InfraOS struct {
|
|
||||||
Infra
|
|
||||||
InfraMachine *InfraMachine `json:"infraMachine,omitempty"`
|
|
||||||
Meta string `json:"meta,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
MetaInfraVendor *meta.MetaInfraVendor `json:"metaInfraVendor,omitempty"`
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import "git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
|
|
||||||
type InfraOSApplication struct {
|
|
||||||
Infra
|
|
||||||
InfraOS *InfraOS `json:"infraOS,omitempty"`
|
|
||||||
Name string `json:"name,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import (
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
type InfraOSDaemon struct {
|
|
||||||
Infra
|
|
||||||
InfraOS *InfraOS `json:"infraOS,omitempty"`
|
|
||||||
Name string `json:"name,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
|
||||||
)
|
|
||||||
|
|
||||||
type InfraOSPort struct {
|
|
||||||
Infra
|
|
||||||
InfraOS *InfraOS `json:"infraOS,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
Port json.Number `json:"port,omitempty"`
|
|
||||||
PortType string `json:"portType,omitempty"`
|
|
||||||
MetaInfraVendor *meta.MetaInfraVendor `json:"metaInfraVendor,omitempty"`
|
|
||||||
TLSType bool `json:"tlsType,omitempty"`
|
|
||||||
}
|
|
11
model/infra/InfraService.go
Normal file
11
model/infra/InfraService.go
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
|
@ -1,18 +0,0 @@
|
||||||
package infra
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
|
||||||
)
|
|
||||||
|
|
||||||
type InfraServiceApplication struct {
|
|
||||||
Infra
|
|
||||||
InfraHost *InfraHost `json:"infraHost,omitempty"`
|
|
||||||
PortType string `json:"portType,omitempty"`
|
|
||||||
Port json.Number `json:"port,omitempty"`
|
|
||||||
MetaInfraVendor *meta.MetaInfraVendor `json:"metaInfraVendor,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
TLSType bool `json:"tlsType,omitempty"`
|
|
||||||
}
|
|
13
model/infra/InfraZone.go
Normal file
13
model/infra/InfraZone.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
package infra
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
package meta
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
|
||||||
)
|
|
||||||
|
|
||||||
type MetaContainer struct {
|
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
|
||||||
Name string `json:"name,omitempty"`
|
|
||||||
Description string `json:"description,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
}
|
|
|
@ -9,7 +9,8 @@ import (
|
||||||
type MetaCrawler struct {
|
type MetaCrawler struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
|
IsDefault bool `json:"isDefault, omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
MetaContainer *MetaContainer `json:"metaContainer,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
13
model/meta/MetaCryptoType.go
Normal file
13
model/meta/MetaCryptoType.go
Normal file
|
@ -0,0 +1,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"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
}
|
|
@ -9,5 +9,6 @@ import (
|
||||||
type MetaHistoryType struct {
|
type MetaHistoryType struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
|
Key string `json:"key, omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
43
model/meta/MetaIPType.go
Normal file
43
model/meta/MetaIPType.go
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
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"`
|
||||||
|
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MetaIPTypeEnum int
|
||||||
|
|
||||||
|
const (
|
||||||
|
MetaIPTypeEnumV4 MetaIPTypeEnum = 1
|
||||||
|
MetaIPTypeEnumV6 MetaIPTypeEnum = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaIPTypeEnumID = map[MetaIPTypeEnum]string {
|
||||||
|
MetaIPTypeEnumV4: "V4",
|
||||||
|
MetaIPTypeEnumV6: "V6",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaIPTypeEnumKey = map[string]MetaIPTypeEnum{
|
||||||
|
"V4": MetaIPTypeEnumV4,
|
||||||
|
"V6": MetaIPTypeEnumV6,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaIPTypeEnum(v *MetaIPType) MetaIPTypeEnum {
|
||||||
|
return metaIPTypeEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaIPType(v MetaIPTypeEnum) *MetaIPType {
|
||||||
|
return &MetaIPType{
|
||||||
|
Key: metaIPTypeEnumID[v],
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,39 @@ import (
|
||||||
|
|
||||||
type MetaInfraType struct {
|
type MetaInfraType struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
|
Key string `json:"key, omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MetaInfraTypeEnum int
|
||||||
|
|
||||||
|
const (
|
||||||
|
MetaInfraTypeEnumZONE MetaInfraTypeEnum = 1
|
||||||
|
MetaInfraTypeEnumHOST MetaInfraTypeEnum = 2
|
||||||
|
MetaInfraTypeEnumService MetaInfraTypeEnum = 3
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaInfraTypeEnumID = map[MetaInfraTypeEnum]string {
|
||||||
|
MetaInfraTypeEnumZONE: "ZONE",
|
||||||
|
MetaInfraTypeEnumHOST: "HOST",
|
||||||
|
MetaInfraTypeEnumService: "SERVICE",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaInfraTypeEnumKey = map[string]MetaInfraTypeEnum{
|
||||||
|
"ZONE": MetaInfraTypeEnumZONE,
|
||||||
|
"HOST": MetaInfraTypeEnumHOST,
|
||||||
|
"SERVICE": MetaInfraTypeEnumService,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaInfraTypeEnum(v *MetaInfraType) MetaInfraTypeEnum {
|
||||||
|
return metaInfraTypeEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaInfraType(v MetaInfraTypeEnum) *MetaInfraType {
|
||||||
|
return &MetaInfraType{
|
||||||
|
Key: metaInfraTypeEnumID[v],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,48 @@
|
||||||
package meta
|
package meta
|
||||||
|
|
||||||
import "encoding/json"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
)
|
||||||
|
|
||||||
type MetaMemberStatus struct {
|
type MetaMemberStatus struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number, omitempty"`
|
||||||
Name string `json:"name,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
|
||||||
|
MetaMemberStatusEnumDORMANCY MetaMemberStatusEnum = 3
|
||||||
|
MetaMemberStatusEnumWITHDRAWAL MetaMemberStatusEnum = 4
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaMemberStatusEnumID = map[MetaMemberStatusEnum]string {
|
||||||
|
MetaMemberStatusEnumNOAUTH: "NOAUTH",
|
||||||
|
MetaMemberStatusEnumNORMAL: "NORMAL",
|
||||||
|
MetaMemberStatusEnumDORMANCY: "DORMANCY",
|
||||||
|
MetaMemberStatusEnumWITHDRAWAL: "WITHDRAWAL",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaMemberStatusEnumKey = map[string]MetaMemberStatusEnum{
|
||||||
|
"NOAUTH": MetaMemberStatusEnumNOAUTH,
|
||||||
|
"NORMAL": MetaMemberStatusEnumNORMAL,
|
||||||
|
"DORMANCY": MetaMemberStatusEnumDORMANCY,
|
||||||
|
"WITHDRAWAL":MetaMemberStatusEnumWITHDRAWAL,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaMemberStatusEnum(v *MetaMemberStatus) MetaMemberStatusEnum {
|
||||||
|
return metaMemberStatusEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaMemberStatus(v MetaMemberStatusEnum) *MetaMemberStatus {
|
||||||
|
return &MetaMemberStatus{
|
||||||
|
Key: metaMemberStatusEnumID[v],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,63 +2,44 @@ package meta
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MetaNoAuthProbeStatus struct {
|
type MetaNoAuthProbeStatus struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Key string `json:"key, omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NoAuthProbeStatusType int
|
type NoAuthProbeStatusEnum int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NoAuthProbeStatusTypeACCEPT NoAuthProbeStatusType = 1 + iota
|
NoAuthProbeStatusEnumACCEPT NoAuthProbeStatusEnum = 1
|
||||||
NoAuthProbeStatusTypeDENY
|
NoAuthProbeStatusEnumDENY NoAuthProbeStatusEnum = 2
|
||||||
NoAuthProbeStatusTypePROCESS
|
NoAuthProbeStatusEnumPROCESSING NoAuthProbeStatusEnum = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
noAuthProbeStatusTypeID = map[NoAuthProbeStatusType]string{
|
noAuthProbeStatusEnumID = map[NoAuthProbeStatusEnum]string{
|
||||||
NoAuthProbeStatusTypeACCEPT: "ACCEPT",
|
NoAuthProbeStatusEnumACCEPT: "ACCEPT",
|
||||||
NoAuthProbeStatusTypeDENY: "DENY",
|
NoAuthProbeStatusEnumDENY: "DENY",
|
||||||
NoAuthProbeStatusTypePROCESS: "PROCESS",
|
NoAuthProbeStatusEnumPROCESSING:"PROCESSING",
|
||||||
}
|
}
|
||||||
|
|
||||||
noAuthProbeStatusTypeName = map[string]NoAuthProbeStatusType{
|
noAuthProbeStatusEnumKey = map[string]NoAuthProbeStatusEnum{
|
||||||
"ACCEPT": NoAuthProbeStatusTypeACCEPT,
|
"ACCEPT": NoAuthProbeStatusEnumACCEPT,
|
||||||
"DENY": NoAuthProbeStatusTypeDENY,
|
"DENY": NoAuthProbeStatusEnumDENY,
|
||||||
"PROCESS": NoAuthProbeStatusTypePROCESS,
|
"PROCESSING": NoAuthProbeStatusEnumPROCESSING,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
func ToNoAuthProbeStatusType(v string) NoAuthProbeStatusType {
|
func ToNoAuthProbeStatusEnum(v *MetaNoAuthProbeStatus) NoAuthProbeStatusEnum {
|
||||||
return noAuthProbeStatusTypeName[v]
|
return noAuthProbeStatusEnumKey[v.Key]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ct NoAuthProbeStatusType) String() string {
|
func ToMetaNoAuthProbeStatus(v NoAuthProbeStatusEnum) *MetaNoAuthProbeStatus {
|
||||||
return noAuthProbeStatusTypeID[ct]
|
return &MetaNoAuthProbeStatus{
|
||||||
}
|
Key: noAuthProbeStatusEnumID[v],
|
||||||
|
|
||||||
func (ct NoAuthProbeStatusType) MarshalJSON() ([]byte, error) {
|
|
||||||
value, ok := noAuthProbeStatusTypeID[ct]
|
|
||||||
if !ok {
|
|
||||||
return nil, fmt.Errorf("Invalid EnumType[%s] value", ct)
|
|
||||||
}
|
}
|
||||||
return json.Marshal(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ct NoAuthProbeStatusType) UnmarshalJSON(b []byte) error {
|
|
||||||
var s string
|
|
||||||
err := json.Unmarshal(b, &s)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
value, ok := noAuthProbeStatusTypeName[s]
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("Invalid EnumType[%s] value", s)
|
|
||||||
}
|
|
||||||
ct = value
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
13
model/meta/MetaPortType.go
Normal file
13
model/meta/MetaPortType.go
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
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"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
}
|
|
@ -1,8 +1,43 @@
|
||||||
package meta
|
package meta
|
||||||
|
|
||||||
import "encoding/json"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
)
|
||||||
|
|
||||||
type MetaProbeStatus struct {
|
type MetaProbeStatus struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
|
Key string `json:"key, omitempty"`
|
||||||
|
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MetaProbeStatusEnum int
|
||||||
|
|
||||||
|
const (
|
||||||
|
MetaProbeStatusEnumINITIAL MetaProbeStatusEnum = 1
|
||||||
|
MetaProbeStatusEnumNORMAL MetaProbeStatusEnum = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaProbeStatusEnumID = map[MetaProbeStatusEnum]string {
|
||||||
|
MetaProbeStatusEnumINITIAL: "INITIAL",
|
||||||
|
MetaProbeStatusEnumNORMAL: "NORMAL",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaProbeStatusEnumKey = map[string]MetaProbeStatusEnum{
|
||||||
|
"INITIAL": MetaProbeStatusEnumINITIAL,
|
||||||
|
"NORMAL": MetaProbeStatusEnumNORMAL,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaProbeStatusEnum(v *MetaProbeStatus) MetaProbeStatusEnum {
|
||||||
|
return metaProbeStatusEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaProbeStatus(v MetaProbeStatusEnum) *MetaProbeStatus {
|
||||||
|
return &MetaProbeStatus{
|
||||||
|
Key: metaProbeStatusEnumID[v],
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,9 +8,11 @@ import (
|
||||||
|
|
||||||
type MetaSensorDisplayItem struct {
|
type MetaSensorDisplayItem struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
|
Key string `json:"key, omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
|
IsDefault bool `json:"isDefault,omitempty"`
|
||||||
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
||||||
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
MetaSensorItemType *MetaSensorItemType `json:"metaSensorItemType,omitempty"`
|
MetaSensorItemType *MetaSensorItemType `json:"metaSensorItemType,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
|
|
||||||
type MetaSensorItem struct {
|
type MetaSensorItem struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
MetaSensorItemType *MetaSensorItemType `json:"metaSensorItemType,omitempty"`
|
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
|
|
|
@ -8,11 +8,12 @@ import (
|
||||||
|
|
||||||
type MetaSensorItemKey struct {
|
type MetaSensorItemKey struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
MetaSensorItem *MetaSensorItem `json:"metaSensorItem,omitempty"`
|
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
|
Name string `json:"name, omitempty"`
|
||||||
Froms string `json:"froms,omitempty"`
|
Froms string `json:"froms,omitempty"`
|
||||||
Option string `json:"option,omitempty"`
|
Option string `json:"option,omitempty"`
|
||||||
|
MetaSensorItem *MetaSensorItem `json:"metaSensorItem,omitempty"`
|
||||||
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,6 @@ import (
|
||||||
type MetaSensorItemType struct {
|
type MetaSensorItemType struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ import (
|
||||||
|
|
||||||
type MetaSensorItemUnit struct {
|
type MetaSensorItemUnit struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
|
Key string `json:"key, omitempty"`
|
||||||
Unit string `json:"unit,omitempty"`
|
Unit string `json:"unit,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
Mark string `json:"mark,omitempty"`
|
Mark string `json:"mark,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package meta
|
package meta
|
||||||
|
|
||||||
import "encoding/json"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
)
|
||||||
|
|
||||||
type MetaSensorStatus struct {
|
type MetaSensorStatus struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Key string `json:"key, omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
33
model/meta/MetaTargetHostType.go
Normal file
33
model/meta/MetaTargetHostType.go
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package meta
|
||||||
|
|
||||||
|
type MetaTargetHostType struct {
|
||||||
|
MetaTargetType
|
||||||
|
}
|
||||||
|
|
||||||
|
type MetaTargetHostTypeEnum int
|
||||||
|
|
||||||
|
const (
|
||||||
|
MetaTargetHostTypeEnumUNKNOWN MetaTargetHostTypeEnum = 100
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaTargetHostTypeEnumID = map[MetaTargetHostTypeEnum]string{
|
||||||
|
MetaTargetHostTypeEnumUNKNOWN: "UNKNOWN",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaTargetHostTypeEnumKey = map[string]MetaTargetHostTypeEnum{
|
||||||
|
"UNKNOWN": MetaTargetHostTypeEnumUNKNOWN,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaTargetHostTypeEnum(v *MetaTargetHostType) MetaTargetHostTypeEnum {
|
||||||
|
return metaTargetHostTypeEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaTargetHostType(v MetaTargetHostTypeEnum) *MetaTargetHostType {
|
||||||
|
m := &MetaTargetHostType {
|
||||||
|
}
|
||||||
|
m.Key = metaTargetHostTypeEnumID[v]
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
33
model/meta/MetaTargetServiceType.go
Normal file
33
model/meta/MetaTargetServiceType.go
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package meta
|
||||||
|
|
||||||
|
type MetaTargetServiceType struct {
|
||||||
|
MetaTargetType
|
||||||
|
}
|
||||||
|
|
||||||
|
type MetaTargetServiceTypeEnum int
|
||||||
|
|
||||||
|
const (
|
||||||
|
MetaTargetServiceTypeEnumUNKNOWN MetaTargetServiceTypeEnum = 1000
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaTargetServiceTypeEnumID = map[MetaTargetServiceTypeEnum]string{
|
||||||
|
MetaTargetServiceTypeEnumUNKNOWN: "UNKNOWN",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaTargetServiceTypeEnumKey = map[string]MetaTargetServiceTypeEnum{
|
||||||
|
"UNKNOWN": MetaTargetServiceTypeEnumUNKNOWN,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaTargetServiceTypeEnum(v *MetaTargetServiceType) MetaTargetServiceTypeEnum {
|
||||||
|
return metaTargetServiceTypeEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaTargetServiceType(v MetaTargetServiceTypeEnum) *MetaTargetServiceType {
|
||||||
|
m := &MetaTargetServiceType {
|
||||||
|
}
|
||||||
|
m.Key = metaTargetServiceTypeEnumID[v]
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
17
model/meta/MetaTargetType.go
Normal file
17
model/meta/MetaTargetType.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
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"`
|
||||||
|
|
||||||
|
}
|
35
model/meta/MetaTargetZoneType.go
Normal file
35
model/meta/MetaTargetZoneType.go
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
package meta
|
||||||
|
|
||||||
|
type MetaTargetZoneType struct {
|
||||||
|
MetaTargetType
|
||||||
|
}
|
||||||
|
|
||||||
|
type MetaTargetZoneTypeEnum int
|
||||||
|
const (
|
||||||
|
MetaTargetZoneTypeEnumUNKNOWN MetaTargetZoneTypeEnum = 1
|
||||||
|
MetaTargetZoneTypeEnumZONE MetaTargetZoneTypeEnum = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
metaTargetZoneTypeEnumID = map[MetaTargetZoneTypeEnum]string{
|
||||||
|
MetaTargetZoneTypeEnumUNKNOWN: "UNKNOWN",
|
||||||
|
MetaTargetZoneTypeEnumZONE: "ZONE",
|
||||||
|
}
|
||||||
|
|
||||||
|
metaTargetZoneTypeEnumKey = map[string]MetaTargetZoneTypeEnum{
|
||||||
|
"UNKNOWN": MetaTargetZoneTypeEnumUNKNOWN,
|
||||||
|
"ZONE": MetaTargetZoneTypeEnumZONE,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToMetaTargetZoneTypeEnum(v *MetaTargetZoneType) MetaTargetZoneTypeEnum {
|
||||||
|
return metaTargetZoneTypeEnumKey[v.Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToMetaTargetZoneType(v MetaTargetZoneTypeEnum) *MetaTargetZoneType {
|
||||||
|
m := &MetaTargetZoneType {
|
||||||
|
}
|
||||||
|
m.Key = metaTargetZoneTypeEnumID[v]
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
|
@ -4,20 +4,20 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
"git.loafle.net/overflow/commons-go/model/domain"
|
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
"git.loafle.net/overflow/commons-go/model/meta"
|
||||||
|
"git.loafle.net/overflow/commons-go/model/domain"
|
||||||
"git.loafle.net/overflow/commons-go/model/probe"
|
"git.loafle.net/overflow/commons-go/model/probe"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NoAuthProbe struct {
|
type NoAuthProbe struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
|
||||||
MetaNoAuthProbeStatus *meta.MetaNoAuthProbeStatus `json:"metaNoAuthProbeStatus,omitempty"`
|
|
||||||
TempProbeKey string `json:"tempProbeKey,omitempty"`
|
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
APIKey string `json:"apiKey,omitempty"`
|
|
||||||
Domain *domain.DomainMember `json:"domain,omitempty"`
|
Domain *domain.DomainMember `json:"domain,omitempty"`
|
||||||
Probe *probe.Probe `json:"probe,omitempty"`
|
Probe *probe.Probe `json:"probe,omitempty"`
|
||||||
|
MetaNoAuthProbeStatus *meta.MetaNoAuthProbeStatus `json:"metaNoAuthProbeStatus,omitempty"`
|
||||||
|
InfraHostMeta string `json:"infraHostMeta, omitempty"`
|
||||||
|
TempProbeKey string `json:"tempProbeKey,omitempty"`
|
||||||
|
APIKey string `json:"apiKey,omitempty"`
|
||||||
ConnectDate *util.Timestamp `json:"connectDate,omitempty"`
|
ConnectDate *util.Timestamp `json:"connectDate,omitempty"`
|
||||||
ConnectAddress string `json:"connectAddress,omitempty"`
|
ConnectAddress string `json:"connectAddress,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,26 +4,24 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"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/domain"
|
||||||
"git.loafle.net/overflow/commons-go/model/member"
|
"git.loafle.net/overflow/commons-go/model/member"
|
||||||
"git.loafle.net/overflow/commons-go/model/meta"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Probe struct {
|
type Probe struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
MetaProbeStatus *meta.MetaProbeStatus `json:"metaProbeStatus,omitempty"`
|
MetaProbeStatus *meta.MetaProbeStatus `json:"metaProbeStatus,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
|
||||||
Domain *domain.Domain `json:"domain,omitempty"`
|
Domain *domain.Domain `json:"domain,omitempty"`
|
||||||
ProbeKey string `json:"probeKey,omitempty"`
|
ProbeKey string `json:"probeKey,omitempty"`
|
||||||
EncryptionKey string `json:"encryptionKey,omitempty"`
|
EncryptionKey string `json:"encryptionKey,omitempty"`
|
||||||
DisplayName string `json:"displayName,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Cidr string `json:"cidr,omitempty"`
|
Cidr string `json:"cidr,omitempty"`
|
||||||
AuthorizeDate *util.Timestamp `json:"authorizeDate,omitempty"`
|
AuthorizeDate *util.Timestamp `json:"authorizeDate,omitempty"`
|
||||||
AuthorizeMember *member.Member `json:"authorizeMember,omitempty"`
|
AuthorizeMember *member.Member `json:"authorizeMember,omitempty"`
|
||||||
|
TargetCount int `json:"targetCount,omitempty"`
|
||||||
ConnectDate *util.Timestamp `json:"connectDate,omitempty"`
|
ConnectDate *util.Timestamp `json:"connectDate,omitempty"`
|
||||||
ConnectAddress string `json:"connectAddress,omitempty"`
|
ConnectAddress string `json:"connectAddress,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
TargetCount int `json:"targetCount,omitempty"`
|
|
||||||
SensorCount int `json:"sensorCount,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,12 @@ import (
|
||||||
|
|
||||||
type Sensor struct {
|
type Sensor struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
Target *target.Target `json:"target, omitempty"`
|
||||||
|
Name string `json:"name, omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
MetaSensorStatus *meta.MetaSensorStatus `json:"metaSensorStatus,omitempty"`
|
MetaSensorStatus *meta.MetaSensorStatus `json:"metaSensorStatus,omitempty"`
|
||||||
Target *target.Target `json:"target,omitempty"`
|
|
||||||
MetaCrawler *meta.MetaCrawler `json:"metaCrawler,omitempty"`
|
MetaCrawler *meta.MetaCrawler `json:"metaCrawler,omitempty"`
|
||||||
CrawlerInputItems string `json:"crawlerInputItems,omitempty"`
|
CrawlerInputItems string `json:"crawlerInputItems,omitempty"`
|
||||||
|
ItemCount json.Number `json:"itemCount,omitempty"`
|
||||||
|
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,12 @@ package sensorconfig
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/constants"
|
"git.loafle.net/overflow/commons-go/model/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Connection struct {
|
type Connection struct {
|
||||||
IP string `json:"ip,omitempty"`
|
IP string `json:"ip,omitempty"`
|
||||||
Port json.Number `json:"port,Number,omitempty"`
|
Port json.Number `json:"port,Number,omitempty"`
|
||||||
PortType constants.PortType `json:"portType,omitempty"`
|
MetaPortType *meta.MetaPortType `json:"metaPortType,omitempty"`
|
||||||
SSL bool `json:"ssl,omitempty"`
|
SSL bool `json:"ssl,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,18 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"git.loafle.net/overflow/commons-go/core/util"
|
"git.loafle.net/overflow/commons-go/core/util"
|
||||||
|
"git.loafle.net/overflow/commons-go/model/infra"
|
||||||
|
"git.loafle.net/overflow/commons-go/model/meta"
|
||||||
|
"git.loafle.net/overflow/commons-go/model/sensor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Target struct {
|
type Target struct {
|
||||||
ID json.Number `json:"id,Number,omitempty"`
|
ID json.Number `json:"id,Number,omitempty"`
|
||||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
Infra *infra.Infra `json:"infra, omitempty"`
|
||||||
DisplayName string `json:"displayName,omitempty"`
|
MetaTargetType *meta.MetaTargetType `json:"metaTargetType, omitempty"`
|
||||||
Description string `json:"description,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"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user