From 06a799f5a6c11b64035f539312c896c781c4501d Mon Sep 17 00:00:00 2001 From: insanity Date: Sun, 12 Aug 2018 19:49:47 +0900 Subject: [PATCH] meta,discovery moved to overflow/ --- core/util/timestamp.go | 42 ----------- model/discovery/DiscoverHost.go | 16 ---- model/discovery/DiscoverPort.go | 28 ------- model/discovery/DiscoverService.go | 5 -- model/discovery/DiscoverZone.go | 7 -- model/discovery/Host.go | 17 ----- model/discovery/Port.go | 20 ----- model/discovery/Service.go | 16 ---- model/discovery/Zone.go | 20 ----- model/meta/MetaCollectionItem.go | 16 ---- model/meta/MetaCollectionItemMapping.go | 13 ---- model/meta/MetaCrawler.go | 13 ---- model/meta/MetaCrawlerContainer.go | 13 ---- model/meta/MetaCrawlerInputItem.go | 13 ---- model/meta/MetaCrawlerMapping.go | 15 ---- model/meta/MetaCryptoType.go | 98 ------------------------- model/meta/MetaDisplayItem.go | 13 ---- model/meta/MetaDisplayItemCategory.go | 14 ---- model/meta/MetaDisplayItemMapping.go | 19 ----- model/meta/MetaHistoryType.go | 14 ---- model/meta/MetaIPType.go | 47 ------------ model/meta/MetaInfraType.go | 50 ------------- model/meta/MetaInputType.go | 14 ---- model/meta/MetaItemUnit.go | 15 ---- model/meta/MetaMemberStatus.go | 53 ------------- model/meta/MetaNoAuthProbeStatus.go | 50 ------------- model/meta/MetaPortType.go | 47 ------------ model/meta/MetaProbeStatus.go | 47 ------------ model/meta/MetaSensorDisplayItem.go | 18 ----- model/meta/MetaSensorItem.go | 14 ---- model/meta/MetaSensorItemKey.go | 19 ----- model/meta/MetaSensorItemType.go | 14 ---- model/meta/MetaSensorItemUnit.go | 15 ---- model/meta/MetaSensorStatus.go | 14 ---- model/meta/MetaTargetHostType.go | 36 --------- model/meta/MetaTargetServiceType.go | 36 --------- model/meta/MetaTargetType.go | 16 ---- model/meta/MetaTargetZoneType.go | 39 ---------- 38 files changed, 956 deletions(-) delete mode 100644 core/util/timestamp.go delete mode 100644 model/discovery/DiscoverHost.go delete mode 100644 model/discovery/DiscoverPort.go delete mode 100644 model/discovery/DiscoverService.go delete mode 100644 model/discovery/DiscoverZone.go delete mode 100644 model/discovery/Host.go delete mode 100644 model/discovery/Port.go delete mode 100644 model/discovery/Service.go delete mode 100644 model/discovery/Zone.go delete mode 100644 model/meta/MetaCollectionItem.go delete mode 100644 model/meta/MetaCollectionItemMapping.go delete mode 100644 model/meta/MetaCrawler.go delete mode 100644 model/meta/MetaCrawlerContainer.go delete mode 100644 model/meta/MetaCrawlerInputItem.go delete mode 100644 model/meta/MetaCrawlerMapping.go delete mode 100644 model/meta/MetaCryptoType.go delete mode 100644 model/meta/MetaDisplayItem.go delete mode 100644 model/meta/MetaDisplayItemCategory.go delete mode 100644 model/meta/MetaDisplayItemMapping.go delete mode 100644 model/meta/MetaHistoryType.go delete mode 100644 model/meta/MetaIPType.go delete mode 100644 model/meta/MetaInfraType.go delete mode 100644 model/meta/MetaInputType.go delete mode 100644 model/meta/MetaItemUnit.go delete mode 100644 model/meta/MetaMemberStatus.go delete mode 100644 model/meta/MetaNoAuthProbeStatus.go delete mode 100644 model/meta/MetaPortType.go delete mode 100644 model/meta/MetaProbeStatus.go delete mode 100644 model/meta/MetaSensorDisplayItem.go delete mode 100644 model/meta/MetaSensorItem.go delete mode 100644 model/meta/MetaSensorItemKey.go delete mode 100644 model/meta/MetaSensorItemType.go delete mode 100644 model/meta/MetaSensorItemUnit.go delete mode 100644 model/meta/MetaSensorStatus.go delete mode 100644 model/meta/MetaTargetHostType.go delete mode 100644 model/meta/MetaTargetServiceType.go delete mode 100644 model/meta/MetaTargetType.go delete mode 100644 model/meta/MetaTargetZoneType.go diff --git a/core/util/timestamp.go b/core/util/timestamp.go deleted file mode 100644 index 623f64a..0000000 --- a/core/util/timestamp.go +++ /dev/null @@ -1,42 +0,0 @@ -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)) -} diff --git a/model/discovery/DiscoverHost.go b/model/discovery/DiscoverHost.go deleted file mode 100644 index c135194..0000000 --- a/model/discovery/DiscoverHost.go +++ /dev/null @@ -1,16 +0,0 @@ -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"` -} diff --git a/model/discovery/DiscoverPort.go b/model/discovery/DiscoverPort.go deleted file mode 100644 index 8e7e37f..0000000 --- a/model/discovery/DiscoverPort.go +++ /dev/null @@ -1,28 +0,0 @@ -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 -} diff --git a/model/discovery/DiscoverService.go b/model/discovery/DiscoverService.go deleted file mode 100644 index 5b32960..0000000 --- a/model/discovery/DiscoverService.go +++ /dev/null @@ -1,5 +0,0 @@ -package discovery - -type DiscoverService struct { - IncludeServices []string `json:"includeServices,omitempty"` -} diff --git a/model/discovery/DiscoverZone.go b/model/discovery/DiscoverZone.go deleted file mode 100644 index 73b078e..0000000 --- a/model/discovery/DiscoverZone.go +++ /dev/null @@ -1,7 +0,0 @@ -package discovery - -type DiscoverZone struct { - ExcludePatterns []string `json:"excludePatterns,omitempty"` - - DiscoverHost *DiscoverHost `json:"discoverHost,omitempty"` -} diff --git a/model/discovery/Host.go b/model/discovery/Host.go deleted file mode 100644 index e392238..0000000 --- a/model/discovery/Host.go +++ /dev/null @@ -1,17 +0,0 @@ -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"` -} diff --git a/model/discovery/Port.go b/model/discovery/Port.go deleted file mode 100644 index e42d5b6..0000000 --- a/model/discovery/Port.go +++ /dev/null @@ -1,20 +0,0 @@ -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:"-"` -} diff --git a/model/discovery/Service.go b/model/discovery/Service.go deleted file mode 100644 index dae8dc2..0000000 --- a/model/discovery/Service.go +++ /dev/null @@ -1,16 +0,0 @@ -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"` -} diff --git a/model/discovery/Zone.go b/model/discovery/Zone.go deleted file mode 100644 index 18a28ee..0000000 --- a/model/discovery/Zone.go +++ /dev/null @@ -1,20 +0,0 @@ -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:"-"` -} diff --git a/model/meta/MetaCollectionItem.go b/model/meta/MetaCollectionItem.go deleted file mode 100644 index ef7605f..0000000 --- a/model/meta/MetaCollectionItem.go +++ /dev/null @@ -1,16 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCollectionItemMapping.go b/model/meta/MetaCollectionItemMapping.go deleted file mode 100644 index b995c40..0000000 --- a/model/meta/MetaCollectionItemMapping.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCrawler.go b/model/meta/MetaCrawler.go deleted file mode 100644 index 508007b..0000000 --- a/model/meta/MetaCrawler.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCrawlerContainer.go b/model/meta/MetaCrawlerContainer.go deleted file mode 100644 index 7ec83c8..0000000 --- a/model/meta/MetaCrawlerContainer.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCrawlerInputItem.go b/model/meta/MetaCrawlerInputItem.go deleted file mode 100644 index d902fe3..0000000 --- a/model/meta/MetaCrawlerInputItem.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCrawlerMapping.go b/model/meta/MetaCrawlerMapping.go deleted file mode 100644 index fa5b88d..0000000 --- a/model/meta/MetaCrawlerMapping.go +++ /dev/null @@ -1,15 +0,0 @@ -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"` -} diff --git a/model/meta/MetaCryptoType.go b/model/meta/MetaCryptoType.go deleted file mode 100644 index 2ae5bd9..0000000 --- a/model/meta/MetaCryptoType.go +++ /dev/null @@ -1,98 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaDisplayItem.go b/model/meta/MetaDisplayItem.go deleted file mode 100644 index 775bc65..0000000 --- a/model/meta/MetaDisplayItem.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` -} diff --git a/model/meta/MetaDisplayItemCategory.go b/model/meta/MetaDisplayItemCategory.go deleted file mode 100644 index 5a71841..0000000 --- a/model/meta/MetaDisplayItemCategory.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaDisplayItemMapping.go b/model/meta/MetaDisplayItemMapping.go deleted file mode 100644 index 5bcd23b..0000000 --- a/model/meta/MetaDisplayItemMapping.go +++ /dev/null @@ -1,19 +0,0 @@ -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"` -} diff --git a/model/meta/MetaHistoryType.go b/model/meta/MetaHistoryType.go deleted file mode 100644 index c7cc201..0000000 --- a/model/meta/MetaHistoryType.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaIPType.go b/model/meta/MetaIPType.go deleted file mode 100644 index c2e413d..0000000 --- a/model/meta/MetaIPType.go +++ /dev/null @@ -1,47 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaInfraType.go b/model/meta/MetaInfraType.go deleted file mode 100644 index c93bba4..0000000 --- a/model/meta/MetaInfraType.go +++ /dev/null @@ -1,50 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaInputType.go b/model/meta/MetaInputType.go deleted file mode 100644 index e2c4053..0000000 --- a/model/meta/MetaInputType.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaItemUnit.go b/model/meta/MetaItemUnit.go deleted file mode 100644 index c334065..0000000 --- a/model/meta/MetaItemUnit.go +++ /dev/null @@ -1,15 +0,0 @@ -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"` -} diff --git a/model/meta/MetaMemberStatus.go b/model/meta/MetaMemberStatus.go deleted file mode 100644 index c524b90..0000000 --- a/model/meta/MetaMemberStatus.go +++ /dev/null @@ -1,53 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaNoAuthProbeStatus.go b/model/meta/MetaNoAuthProbeStatus.go deleted file mode 100644 index 84713f7..0000000 --- a/model/meta/MetaNoAuthProbeStatus.go +++ /dev/null @@ -1,50 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaPortType.go b/model/meta/MetaPortType.go deleted file mode 100644 index ca7bb00..0000000 --- a/model/meta/MetaPortType.go +++ /dev/null @@ -1,47 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaProbeStatus.go b/model/meta/MetaProbeStatus.go deleted file mode 100644 index 51c304a..0000000 --- a/model/meta/MetaProbeStatus.go +++ /dev/null @@ -1,47 +0,0 @@ -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], - } -} diff --git a/model/meta/MetaSensorDisplayItem.go b/model/meta/MetaSensorDisplayItem.go deleted file mode 100644 index 9b05c3b..0000000 --- a/model/meta/MetaSensorDisplayItem.go +++ /dev/null @@ -1,18 +0,0 @@ -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"` -} diff --git a/model/meta/MetaSensorItem.go b/model/meta/MetaSensorItem.go deleted file mode 100644 index a05a93e..0000000 --- a/model/meta/MetaSensorItem.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaSensorItemKey.go b/model/meta/MetaSensorItemKey.go deleted file mode 100644 index 5f3d3e2..0000000 --- a/model/meta/MetaSensorItemKey.go +++ /dev/null @@ -1,19 +0,0 @@ -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"` -} diff --git a/model/meta/MetaSensorItemType.go b/model/meta/MetaSensorItemType.go deleted file mode 100644 index b7ee5bf..0000000 --- a/model/meta/MetaSensorItemType.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaSensorItemUnit.go b/model/meta/MetaSensorItemUnit.go deleted file mode 100644 index a14d001..0000000 --- a/model/meta/MetaSensorItemUnit.go +++ /dev/null @@ -1,15 +0,0 @@ -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"` -} diff --git a/model/meta/MetaSensorStatus.go b/model/meta/MetaSensorStatus.go deleted file mode 100644 index 3e25bca..0000000 --- a/model/meta/MetaSensorStatus.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` -} diff --git a/model/meta/MetaTargetHostType.go b/model/meta/MetaTargetHostType.go deleted file mode 100644 index 974a6aa..0000000 --- a/model/meta/MetaTargetHostType.go +++ /dev/null @@ -1,36 +0,0 @@ -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 -} diff --git a/model/meta/MetaTargetServiceType.go b/model/meta/MetaTargetServiceType.go deleted file mode 100644 index 6276079..0000000 --- a/model/meta/MetaTargetServiceType.go +++ /dev/null @@ -1,36 +0,0 @@ -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 -} diff --git a/model/meta/MetaTargetType.go b/model/meta/MetaTargetType.go deleted file mode 100644 index 42c43c0..0000000 --- a/model/meta/MetaTargetType.go +++ /dev/null @@ -1,16 +0,0 @@ -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"` -} diff --git a/model/meta/MetaTargetZoneType.go b/model/meta/MetaTargetZoneType.go deleted file mode 100644 index 77af1ba..0000000 --- a/model/meta/MetaTargetZoneType.go +++ /dev/null @@ -1,39 +0,0 @@ -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 -}