Revert "meta,discovery moved to overflow/"
This reverts commit 06a799f5a6
This commit is contained in:
parent
06a799f5a6
commit
28cd64a0c2
42
core/util/timestamp.go
Normal file
42
core/util/timestamp.go
Normal file
|
@ -0,0 +1,42 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Timestamp time.Time
|
||||
|
||||
func (t Timestamp) MarshalJSON() ([]byte, error) {
|
||||
ts := time.Time(t).Unix()
|
||||
stamp := fmt.Sprint(ts * 1000)
|
||||
return []byte(stamp), nil
|
||||
}
|
||||
|
||||
func (t *Timestamp) UnmarshalJSON(b []byte) error {
|
||||
ts, err := strconv.Atoi(string(b))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*t = Timestamp(time.Unix(int64(ts)/1000, 0))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t Timestamp) String() string {
|
||||
return time.Time(t).String()
|
||||
}
|
||||
|
||||
func Now() Timestamp {
|
||||
return Timestamp(time.Now())
|
||||
}
|
||||
|
||||
func NowPtr() *Timestamp {
|
||||
n := Now()
|
||||
return &n
|
||||
}
|
||||
|
||||
func Date(year int, month time.Month, day int) Timestamp {
|
||||
return Timestamp(time.Date(year, month, day, 0, 0, 0, 0, time.UTC))
|
||||
}
|
16
model/discovery/DiscoverHost.go
Normal file
16
model/discovery/DiscoverHost.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package discovery
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/commons-go/model/meta"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
28
model/discovery/DiscoverPort.go
Normal file
28
model/discovery/DiscoverPort.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package discovery
|
||||
|
||||
type DiscoverPort struct {
|
||||
FirstScanRange int `json:"firstScanRange,omitempty"`
|
||||
LastScanRange int `json:"lastScanRange,omitempty"`
|
||||
ExcludePorts []int `json:"excludePorts,omitempty"`
|
||||
|
||||
IncludeTCP bool `json:"includeTCP,omitempty"`
|
||||
IncludeUDP bool `json:"includeUDP,omitempty"`
|
||||
|
||||
DiscoverService *DiscoverService `json:"discoverService,omitempty"`
|
||||
}
|
||||
|
||||
func (dp *DiscoverPort) Contains(port int) bool {
|
||||
if dp.FirstScanRange > port {
|
||||
return false
|
||||
}
|
||||
if dp.LastScanRange < port {
|
||||
return false
|
||||
}
|
||||
for _, p := range dp.ExcludePorts {
|
||||
if p == port {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
5
model/discovery/DiscoverService.go
Normal file
5
model/discovery/DiscoverService.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package discovery
|
||||
|
||||
type DiscoverService struct {
|
||||
IncludeServices []string `json:"includeServices,omitempty"`
|
||||
}
|
7
model/discovery/DiscoverZone.go
Normal file
7
model/discovery/DiscoverZone.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package discovery
|
||||
|
||||
type DiscoverZone struct {
|
||||
ExcludePatterns []string `json:"excludePatterns,omitempty"`
|
||||
|
||||
DiscoverHost *DiscoverHost `json:"discoverHost,omitempty"`
|
||||
}
|
17
model/discovery/Host.go
Normal file
17
model/discovery/Host.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package discovery
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
"git.loafle.net/overflow/commons-go/model/meta"
|
||||
)
|
||||
|
||||
type Host struct {
|
||||
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"`
|
||||
|
||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
||||
}
|
20
model/discovery/Port.go
Normal file
20
model/discovery/Port.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package discovery
|
||||
|
||||
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 {
|
||||
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"`
|
||||
|
||||
UDPLayer gopacket.Layer `json:"-"`
|
||||
}
|
16
model/discovery/Service.go
Normal file
16
model/discovery/Service.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package discovery
|
||||
|
||||
import (
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
"git.loafle.net/overflow/commons-go/model/meta"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
MetaCryptoType *meta.MetaCryptoType `json:"metaCryptoType,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
Port *Port `json:"port,omitempty"`
|
||||
|
||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
||||
}
|
20
model/discovery/Zone.go
Normal file
20
model/discovery/Zone.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package discovery
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
"git.loafle.net/overflow/commons-go/model/meta"
|
||||
)
|
||||
|
||||
type Zone struct {
|
||||
Network string `json:"network,omitempty"`
|
||||
Iface string `json:"iface,omitempty"`
|
||||
MetaIPType *meta.MetaIPType `json:"metaIPType,omitempty"`
|
||||
Address string `json:"address,omitempty"`
|
||||
Mac string `json:"mac,omitempty"`
|
||||
|
||||
DiscoveredDate *util.Timestamp `json:"discoveredDate,omitempty"`
|
||||
|
||||
mtx sync.RWMutex `json:"-"`
|
||||
}
|
16
model/meta/MetaCollectionItem.go
Normal file
16
model/meta/MetaCollectionItem.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCollectionItem struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Item string `json:"item,omitempty"`
|
||||
ItemClass string `json:"itemClass,omitempty"`
|
||||
MetaItemUnit *MetaItemUnit `json:"metaItemUnit,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
13
model/meta/MetaCollectionItemMapping.go
Normal file
13
model/meta/MetaCollectionItemMapping.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCollectionItemMapping struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
MetaDisplayItemMapping *MetaDisplayItemMapping `json:"metaDisplayItemMapping,omitempty"`
|
||||
MetaCollectionItem *MetaCollectionItem `json:"metaCollectionItem,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
13
model/meta/MetaCrawler.go
Normal file
13
model/meta/MetaCrawler.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCrawler struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
13
model/meta/MetaCrawlerContainer.go
Normal file
13
model/meta/MetaCrawlerContainer.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCrawlerContainer struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
13
model/meta/MetaCrawlerInputItem.go
Normal file
13
model/meta/MetaCrawlerInputItem.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCrawlerInputItem struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
MetaInputType *MetaInputType `json:"metaInputType,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
15
model/meta/MetaCrawlerMapping.go
Normal file
15
model/meta/MetaCrawlerMapping.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaCrawlerMapping struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
MetaTargetType *MetaTargetType `json:"metaTargetType,Number,omitempty"`
|
||||
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
||||
DefaultInterval json.Number `json:"defaultInterval,omitempty"`
|
||||
IsDefault bool `json:"isDefault,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
98
model/meta/MetaCryptoType.go
Normal file
98
model/meta/MetaCryptoType.go
Normal file
|
@ -0,0 +1,98 @@
|
|||
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"`
|
||||
}
|
||||
|
||||
type MetaCryptoTypeEnum int
|
||||
|
||||
const (
|
||||
MetaCryptoTypeEnumNONE MetaCryptoTypeEnum = iota + 1
|
||||
MetaCryptoTypeEnumUNKNOWN
|
||||
MetaCryptoTypeEnumAES
|
||||
MetaCryptoTypeEnumCIPHER
|
||||
MetaCryptoTypeEnumDES
|
||||
MetaCryptoTypeEnumDSA
|
||||
MetaCryptoTypeEnumECDSA
|
||||
MetaCryptoTypeEnumELLIPTIC
|
||||
MetaCryptoTypeEnumHMAC
|
||||
MetaCryptoTypeEnumMD5
|
||||
MetaCryptoTypeEnumRAND
|
||||
MetaCryptoTypeEnumRC4
|
||||
MetaCryptoTypeEnumRSA
|
||||
MetaCryptoTypeEnumSHA1
|
||||
MetaCryptoTypeEnumSHA256
|
||||
MetaCryptoTypeEnumSUBTLE
|
||||
MetaCryptoTypeEnumTLS
|
||||
MetaCryptoTypeEnumX509
|
||||
MetaCryptoTypeEnumPKIX
|
||||
)
|
||||
|
||||
var (
|
||||
metaCryptoTypeEnumID = map[MetaCryptoTypeEnum]string{
|
||||
MetaCryptoTypeEnumNONE: "NONE",
|
||||
MetaCryptoTypeEnumUNKNOWN: "UNKNOWN",
|
||||
MetaCryptoTypeEnumAES: "AES",
|
||||
MetaCryptoTypeEnumCIPHER: "CIPHER",
|
||||
MetaCryptoTypeEnumDES: "DES",
|
||||
MetaCryptoTypeEnumDSA: "DSA",
|
||||
MetaCryptoTypeEnumECDSA: "ECDSA",
|
||||
MetaCryptoTypeEnumELLIPTIC: "ELLIPTIC",
|
||||
MetaCryptoTypeEnumHMAC: "HMAC",
|
||||
MetaCryptoTypeEnumMD5: "MD5",
|
||||
MetaCryptoTypeEnumRAND: "RAND",
|
||||
MetaCryptoTypeEnumRC4: "RC4",
|
||||
MetaCryptoTypeEnumRSA: "RSA",
|
||||
MetaCryptoTypeEnumSHA1: "SHA1",
|
||||
MetaCryptoTypeEnumSHA256: "SHA256",
|
||||
MetaCryptoTypeEnumSUBTLE: "SUBTLE",
|
||||
MetaCryptoTypeEnumTLS: "TLS",
|
||||
MetaCryptoTypeEnumX509: "X509",
|
||||
MetaCryptoTypeEnumPKIX: "PKIX",
|
||||
}
|
||||
|
||||
metaCryptoTypeEnumKey = map[string]MetaCryptoTypeEnum{
|
||||
"NONE": MetaCryptoTypeEnumNONE,
|
||||
"UNKNOWN": MetaCryptoTypeEnumUNKNOWN,
|
||||
"AES": MetaCryptoTypeEnumAES,
|
||||
"CIPHER": MetaCryptoTypeEnumCIPHER,
|
||||
"DES": MetaCryptoTypeEnumDES,
|
||||
"DSA": MetaCryptoTypeEnumDSA,
|
||||
"ECDSA": MetaCryptoTypeEnumECDSA,
|
||||
"ELLIPTIC": MetaCryptoTypeEnumELLIPTIC,
|
||||
"HMAC": MetaCryptoTypeEnumHMAC,
|
||||
"MD5": MetaCryptoTypeEnumMD5,
|
||||
"RAND": MetaCryptoTypeEnumRAND,
|
||||
"RC4": MetaCryptoTypeEnumRC4,
|
||||
"RSA": MetaCryptoTypeEnumRSA,
|
||||
"SHA1": MetaCryptoTypeEnumSHA1,
|
||||
"SHA256": MetaCryptoTypeEnumSHA256,
|
||||
"SUBTLE": MetaCryptoTypeEnumSUBTLE,
|
||||
"TLS": MetaCryptoTypeEnumTLS,
|
||||
"X509": MetaCryptoTypeEnumX509,
|
||||
"PKIX": MetaCryptoTypeEnumPKIX,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaCryptoTypeEnum) String() string {
|
||||
return metaCryptoTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaCryptoTypeEnum(v *MetaCryptoType) MetaCryptoTypeEnum {
|
||||
return metaCryptoTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaCryptoType(v MetaCryptoTypeEnum) *MetaCryptoType {
|
||||
return &MetaCryptoType{
|
||||
Key: metaCryptoTypeEnumID[v],
|
||||
}
|
||||
}
|
13
model/meta/MetaDisplayItem.go
Normal file
13
model/meta/MetaDisplayItem.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaDisplayItem struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
14
model/meta/MetaDisplayItemCategory.go
Normal file
14
model/meta/MetaDisplayItemCategory.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaDisplayItemCategory struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
19
model/meta/MetaDisplayItemMapping.go
Normal file
19
model/meta/MetaDisplayItemMapping.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaDisplayItemMapping struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
MetaDisplayItem *MetaDisplayItem `json:"metaDisplayItem,omitempty"`
|
||||
MetaCrawlerMapping *MetaCrawlerMapping `json:"metaCrawlerMapping,omitempty"`
|
||||
MetaItemUnit *MetaItemUnit `json:"metaItemUnit,omitempty"`
|
||||
MetaDisplayItemCategory *MetaDisplayItemCategory `json:"metaDisplayItemCategory,omitempty"`
|
||||
IsDefault bool `json:"isDefault,omitempty"`
|
||||
Formula string `json:"formula,omitempty"`
|
||||
Priority json.Number `json:"priority,omitempty"`
|
||||
IsRequired bool `json:"isRequired,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
14
model/meta/MetaHistoryType.go
Normal file
14
model/meta/MetaHistoryType.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaHistoryType struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
47
model/meta/MetaIPType.go
Normal file
47
model/meta/MetaIPType.go
Normal file
|
@ -0,0 +1,47 @@
|
|||
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 = iota + 1
|
||||
MetaIPTypeEnumV6
|
||||
)
|
||||
|
||||
var (
|
||||
metaIPTypeEnumID = map[MetaIPTypeEnum]string{
|
||||
MetaIPTypeEnumV4: "V4",
|
||||
MetaIPTypeEnumV6: "V6",
|
||||
}
|
||||
|
||||
metaIPTypeEnumKey = map[string]MetaIPTypeEnum{
|
||||
"V4": MetaIPTypeEnumV4,
|
||||
"V6": MetaIPTypeEnumV6,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaIPTypeEnum) String() string {
|
||||
return metaIPTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaIPTypeEnum(v *MetaIPType) MetaIPTypeEnum {
|
||||
return metaIPTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaIPType(v MetaIPTypeEnum) *MetaIPType {
|
||||
return &MetaIPType{
|
||||
Key: metaIPTypeEnumID[v],
|
||||
}
|
||||
}
|
50
model/meta/MetaInfraType.go
Normal file
50
model/meta/MetaInfraType.go
Normal file
|
@ -0,0 +1,50 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaInfraType struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
||||
|
||||
type MetaInfraTypeEnum int
|
||||
|
||||
const (
|
||||
MetaInfraTypeEnumZONE MetaInfraTypeEnum = iota + 1
|
||||
MetaInfraTypeEnumHOST
|
||||
MetaInfraTypeEnumService
|
||||
)
|
||||
|
||||
var (
|
||||
metaInfraTypeEnumID = map[MetaInfraTypeEnum]string{
|
||||
MetaInfraTypeEnumZONE: "ZONE",
|
||||
MetaInfraTypeEnumHOST: "HOST",
|
||||
MetaInfraTypeEnumService: "SERVICE",
|
||||
}
|
||||
|
||||
metaInfraTypeEnumKey = map[string]MetaInfraTypeEnum{
|
||||
"ZONE": MetaInfraTypeEnumZONE,
|
||||
"HOST": MetaInfraTypeEnumHOST,
|
||||
"SERVICE": MetaInfraTypeEnumService,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaInfraTypeEnum) String() string {
|
||||
return metaInfraTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaInfraTypeEnum(v *MetaInfraType) MetaInfraTypeEnum {
|
||||
return metaInfraTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaInfraType(v MetaInfraTypeEnum) *MetaInfraType {
|
||||
return &MetaInfraType{
|
||||
Key: metaInfraTypeEnumID[v],
|
||||
}
|
||||
}
|
14
model/meta/MetaInputType.go
Normal file
14
model/meta/MetaInputType.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaInputType struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
15
model/meta/MetaItemUnit.go
Normal file
15
model/meta/MetaItemUnit.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaItemUnit struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Unit string `json:"unit,omitempty"`
|
||||
Mark string `json:"mark,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
53
model/meta/MetaMemberStatus.go
Normal file
53
model/meta/MetaMemberStatus.go
Normal file
|
@ -0,0 +1,53 @@
|
|||
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"`
|
||||
}
|
||||
|
||||
type MetaMemberStatusEnum int
|
||||
|
||||
const (
|
||||
MetaMemberStatusEnumNOAUTH MetaMemberStatusEnum = iota + 1
|
||||
MetaMemberStatusEnumNORMAL
|
||||
MetaMemberStatusEnumDORMANCY
|
||||
MetaMemberStatusEnumWITHDRAWAL
|
||||
)
|
||||
|
||||
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 (e MetaMemberStatusEnum) String() string {
|
||||
return metaMemberStatusEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaMemberStatusEnum(v *MetaMemberStatus) MetaMemberStatusEnum {
|
||||
return metaMemberStatusEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaMemberStatus(v MetaMemberStatusEnum) *MetaMemberStatus {
|
||||
return &MetaMemberStatus{
|
||||
Key: metaMemberStatusEnumID[v],
|
||||
}
|
||||
}
|
50
model/meta/MetaNoAuthProbeStatus.go
Normal file
50
model/meta/MetaNoAuthProbeStatus.go
Normal file
|
@ -0,0 +1,50 @@
|
|||
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"`
|
||||
Name string `json:"name,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
||||
|
||||
type MetaNoAuthProbeStatusEnum int
|
||||
|
||||
const (
|
||||
MetaNoAuthProbeStatusEnumACCEPT MetaNoAuthProbeStatusEnum = iota + 1
|
||||
MetaNoAuthProbeStatusEnumDENY
|
||||
MetaNoAuthProbeStatusEnumPROCESSING
|
||||
)
|
||||
|
||||
var (
|
||||
metaNoAuthProbeStatusEnumID = map[MetaNoAuthProbeStatusEnum]string{
|
||||
MetaNoAuthProbeStatusEnumACCEPT: "ACCEPT",
|
||||
MetaNoAuthProbeStatusEnumDENY: "DENY",
|
||||
MetaNoAuthProbeStatusEnumPROCESSING: "PROCESSING",
|
||||
}
|
||||
|
||||
metaNoAuthProbeStatusEnumKey = map[string]MetaNoAuthProbeStatusEnum{
|
||||
"ACCEPT": MetaNoAuthProbeStatusEnumACCEPT,
|
||||
"DENY": MetaNoAuthProbeStatusEnumDENY,
|
||||
"PROCESSING": MetaNoAuthProbeStatusEnumPROCESSING,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaNoAuthProbeStatusEnum) String() string {
|
||||
return metaNoAuthProbeStatusEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaNoAuthProbeStatusEnum(v *MetaNoAuthProbeStatus) MetaNoAuthProbeStatusEnum {
|
||||
return metaNoAuthProbeStatusEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaNoAuthProbeStatus(v MetaNoAuthProbeStatusEnum) *MetaNoAuthProbeStatus {
|
||||
return &MetaNoAuthProbeStatus{
|
||||
Key: metaNoAuthProbeStatusEnumID[v],
|
||||
}
|
||||
}
|
47
model/meta/MetaPortType.go
Normal file
47
model/meta/MetaPortType.go
Normal file
|
@ -0,0 +1,47 @@
|
|||
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"`
|
||||
}
|
||||
|
||||
type MetaPortTypeEnum int
|
||||
|
||||
const (
|
||||
MetaPortTypeEnumTCP MetaPortTypeEnum = iota + 1
|
||||
MetaPortTypeEnumUDP
|
||||
)
|
||||
|
||||
var (
|
||||
metaPortTypeEnumID = map[MetaPortTypeEnum]string{
|
||||
MetaPortTypeEnumTCP: "TCP",
|
||||
MetaPortTypeEnumUDP: "UDP",
|
||||
}
|
||||
|
||||
metaPortTypeEnumKey = map[string]MetaPortTypeEnum{
|
||||
"TCP": MetaPortTypeEnumTCP,
|
||||
"UDP": MetaPortTypeEnumUDP,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaPortTypeEnum) String() string {
|
||||
return metaPortTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaPortTypeEnum(v *MetaPortType) MetaPortTypeEnum {
|
||||
return metaPortTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaPortType(v MetaPortTypeEnum) *MetaPortType {
|
||||
return &MetaPortType{
|
||||
Key: metaPortTypeEnumID[v],
|
||||
}
|
||||
}
|
47
model/meta/MetaProbeStatus.go
Normal file
47
model/meta/MetaProbeStatus.go
Normal file
|
@ -0,0 +1,47 @@
|
|||
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"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
||||
|
||||
type MetaProbeStatusEnum int
|
||||
|
||||
const (
|
||||
MetaProbeStatusEnumINITIAL MetaProbeStatusEnum = iota + 1
|
||||
MetaProbeStatusEnumNORMAL
|
||||
)
|
||||
|
||||
var (
|
||||
metaProbeStatusEnumID = map[MetaProbeStatusEnum]string{
|
||||
MetaProbeStatusEnumINITIAL: "INITIAL",
|
||||
MetaProbeStatusEnumNORMAL: "NORMAL",
|
||||
}
|
||||
|
||||
metaProbeStatusEnumKey = map[string]MetaProbeStatusEnum{
|
||||
"INITIAL": MetaProbeStatusEnumINITIAL,
|
||||
"NORMAL": MetaProbeStatusEnumNORMAL,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaProbeStatusEnum) String() string {
|
||||
return metaProbeStatusEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaProbeStatusEnum(v *MetaProbeStatus) MetaProbeStatusEnum {
|
||||
return metaProbeStatusEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaProbeStatus(v MetaProbeStatusEnum) *MetaProbeStatus {
|
||||
return &MetaProbeStatus{
|
||||
Key: metaProbeStatusEnumID[v],
|
||||
}
|
||||
}
|
18
model/meta/MetaSensorDisplayItem.go
Normal file
18
model/meta/MetaSensorDisplayItem.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaSensorDisplayItem struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
IsDefault bool `json:"isDefault,omitempty"`
|
||||
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
||||
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
||||
MetaSensorItemType *MetaSensorItemType `json:"metaSensorItemType,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
14
model/meta/MetaSensorItem.go
Normal file
14
model/meta/MetaSensorItem.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaSensorItem struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
19
model/meta/MetaSensorItemKey.go
Normal file
19
model/meta/MetaSensorItemKey.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaSensorItemKey struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Froms string `json:"froms,omitempty"`
|
||||
Option string `json:"option,omitempty"`
|
||||
MetaSensorItem *MetaSensorItem `json:"metaSensorItem,omitempty"`
|
||||
MetaCrawler *MetaCrawler `json:"metaCrawler,omitempty"`
|
||||
MetaSensorItemUnit *MetaSensorItemUnit `json:"metaSensorItemUnit,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
14
model/meta/MetaSensorItemType.go
Normal file
14
model/meta/MetaSensorItemType.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaSensorItemType struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
15
model/meta/MetaSensorItemUnit.go
Normal file
15
model/meta/MetaSensorItemUnit.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaSensorItemUnit struct {
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
Unit string `json:"unit,omitempty"`
|
||||
Mark string `json:"mark,omitempty"`
|
||||
CreateDate *util.Timestamp `json:"createDate,omitempty"`
|
||||
}
|
14
model/meta/MetaSensorStatus.go
Normal file
14
model/meta/MetaSensorStatus.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
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"`
|
||||
}
|
36
model/meta/MetaTargetHostType.go
Normal file
36
model/meta/MetaTargetHostType.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package meta
|
||||
|
||||
type MetaTargetHostType struct {
|
||||
MetaTargetType
|
||||
}
|
||||
|
||||
type MetaTargetHostTypeEnum int
|
||||
|
||||
const (
|
||||
MetaTargetHostTypeEnumUNKNOWN MetaTargetHostTypeEnum = iota + 1
|
||||
)
|
||||
|
||||
var (
|
||||
metaTargetHostTypeEnumID = map[MetaTargetHostTypeEnum]string{
|
||||
MetaTargetHostTypeEnumUNKNOWN: "UNKNOWN",
|
||||
}
|
||||
|
||||
metaTargetHostTypeEnumKey = map[string]MetaTargetHostTypeEnum{
|
||||
"UNKNOWN": MetaTargetHostTypeEnumUNKNOWN,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaTargetHostTypeEnum) String() string {
|
||||
return metaTargetHostTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaTargetHostTypeEnum(v *MetaTargetHostType) MetaTargetHostTypeEnum {
|
||||
return metaTargetHostTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaTargetHostType(v MetaTargetHostTypeEnum) *MetaTargetHostType {
|
||||
m := &MetaTargetHostType{}
|
||||
m.Key = metaTargetHostTypeEnumID[v]
|
||||
|
||||
return m
|
||||
}
|
36
model/meta/MetaTargetServiceType.go
Normal file
36
model/meta/MetaTargetServiceType.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package meta
|
||||
|
||||
type MetaTargetServiceType struct {
|
||||
MetaTargetType
|
||||
}
|
||||
|
||||
type MetaTargetServiceTypeEnum int
|
||||
|
||||
const (
|
||||
MetaTargetServiceTypeEnumUNKNOWN MetaTargetServiceTypeEnum = iota + 1
|
||||
)
|
||||
|
||||
var (
|
||||
metaTargetServiceTypeEnumID = map[MetaTargetServiceTypeEnum]string{
|
||||
MetaTargetServiceTypeEnumUNKNOWN: "UNKNOWN",
|
||||
}
|
||||
|
||||
metaTargetServiceTypeEnumKey = map[string]MetaTargetServiceTypeEnum{
|
||||
"UNKNOWN": MetaTargetServiceTypeEnumUNKNOWN,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaTargetServiceTypeEnum) String() string {
|
||||
return metaTargetServiceTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaTargetServiceTypeEnum(v *MetaTargetServiceType) MetaTargetServiceTypeEnum {
|
||||
return metaTargetServiceTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaTargetServiceType(v MetaTargetServiceTypeEnum) *MetaTargetServiceType {
|
||||
m := &MetaTargetServiceType{}
|
||||
m.Key = metaTargetServiceTypeEnumID[v]
|
||||
|
||||
return m
|
||||
}
|
16
model/meta/MetaTargetType.go
Normal file
16
model/meta/MetaTargetType.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package meta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.loafle.net/overflow/commons-go/core/util"
|
||||
)
|
||||
|
||||
type MetaTargetType struct {
|
||||
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"`
|
||||
}
|
39
model/meta/MetaTargetZoneType.go
Normal file
39
model/meta/MetaTargetZoneType.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package meta
|
||||
|
||||
type MetaTargetZoneType struct {
|
||||
MetaTargetType
|
||||
}
|
||||
|
||||
type MetaTargetZoneTypeEnum int
|
||||
|
||||
const (
|
||||
MetaTargetZoneTypeEnumUNKNOWN MetaTargetZoneTypeEnum = iota + 1
|
||||
MetaTargetZoneTypeEnumZONE
|
||||
)
|
||||
|
||||
var (
|
||||
metaTargetZoneTypeEnumID = map[MetaTargetZoneTypeEnum]string{
|
||||
MetaTargetZoneTypeEnumUNKNOWN: "UNKNOWN",
|
||||
MetaTargetZoneTypeEnumZONE: "ZONE",
|
||||
}
|
||||
|
||||
metaTargetZoneTypeEnumKey = map[string]MetaTargetZoneTypeEnum{
|
||||
"UNKNOWN": MetaTargetZoneTypeEnumUNKNOWN,
|
||||
"ZONE": MetaTargetZoneTypeEnumZONE,
|
||||
}
|
||||
)
|
||||
|
||||
func (e MetaTargetZoneTypeEnum) String() string {
|
||||
return metaTargetZoneTypeEnumID[e]
|
||||
}
|
||||
|
||||
func ToMetaTargetZoneTypeEnum(v *MetaTargetZoneType) MetaTargetZoneTypeEnum {
|
||||
return metaTargetZoneTypeEnumKey[v.Key]
|
||||
}
|
||||
|
||||
func ToMetaTargetZoneType(v MetaTargetZoneTypeEnum) *MetaTargetZoneType {
|
||||
m := &MetaTargetZoneType{}
|
||||
m.Key = metaTargetZoneTypeEnumID[v]
|
||||
|
||||
return m
|
||||
}
|
Loading…
Reference in New Issue
Block a user