ing
This commit is contained in:
parent
a0c0fefa8d
commit
3f116f1343
|
@ -1,53 +1,11 @@
|
|||
package model
|
||||
|
||||
type Connection struct {
|
||||
IP string `json:"ip,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
PortType string `json:"portType,omitempty"`
|
||||
SSL bool `json:"ssl,omitempty"`
|
||||
}
|
||||
|
||||
type Target struct {
|
||||
Auth map[string]interface{} `json:"auth,omitempty"`
|
||||
Connection Connection `json:"connection,omitempty"`
|
||||
}
|
||||
|
||||
type Schedule struct {
|
||||
Interval string `json:"interval,omitempty"`
|
||||
}
|
||||
|
||||
type Keys struct {
|
||||
Metric string `json:"metric,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
}
|
||||
|
||||
type QueryInfo struct {
|
||||
Query string `json:"query,omitempty"`
|
||||
Extend map[string]interface{} `json:"extend,omitempty"`
|
||||
}
|
||||
|
||||
type MappingInfo struct {
|
||||
ParseDirection string `json:"parseDirection,omitempty"`
|
||||
ArrayColumns []string `json:"arrayColumns,omitempty"`
|
||||
KeyColumns []string `json:"keyColumns,omitempty"`
|
||||
ValueColumn string `json:"valueColumn,omitempty"`
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
Keys []Keys `json:"keys,omitempty"`
|
||||
QueryInfo QueryInfo `json:"queryInfo,omitempty"`
|
||||
MappingInfo MappingInfo `json:"mappingInfo,omitempty"`
|
||||
}
|
||||
|
||||
type Crawler struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Container string `json:"container,omitempty"`
|
||||
}
|
||||
import "encoding/json"
|
||||
|
||||
type Config struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Target Target `json:"target,omitempty"`
|
||||
Schedule Schedule `json:"schedule,omitempty"`
|
||||
Crawler Crawler `json:"crawler,omitempty"`
|
||||
ID json.Number `json:"id,Number,omitempty"`
|
||||
Target *Target `json:"target,omitempty"`
|
||||
Schedule *Schedule `json:"schedule,omitempty"`
|
||||
Crawler *Crawler `json:"crawler,omitempty"`
|
||||
Items []Item `json:"items,omitempty"`
|
||||
}
|
||||
|
|
8
modules/config/model/Connection.go
Normal file
8
modules/config/model/Connection.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package model
|
||||
|
||||
type Connection struct {
|
||||
IP string `json:"ip,omitempty"`
|
||||
Port string `json:"port,omitempty"`
|
||||
PortType string `json:"portType,omitempty"`
|
||||
SSL bool `json:"ssl,omitempty"`
|
||||
}
|
6
modules/config/model/Crawler.go
Normal file
6
modules/config/model/Crawler.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package model
|
||||
|
||||
type Crawler struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Container string `json:"container,omitempty"`
|
||||
}
|
7
modules/config/model/Item.go
Normal file
7
modules/config/model/Item.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package model
|
||||
|
||||
type Item struct {
|
||||
Keys []Keys `json:"keys,omitempty"`
|
||||
QueryInfo *QueryInfo `json:"queryInfo,omitempty"`
|
||||
MappingInfo *MappingInfo `json:"mappingInfo,omitempty"`
|
||||
}
|
6
modules/config/model/Keys.go
Normal file
6
modules/config/model/Keys.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package model
|
||||
|
||||
type Keys struct {
|
||||
Metric string `json:"metric,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
}
|
8
modules/config/model/MappingInfo.go
Normal file
8
modules/config/model/MappingInfo.go
Normal file
|
@ -0,0 +1,8 @@
|
|||
package model
|
||||
|
||||
type MappingInfo struct {
|
||||
ParseDirection string `json:"parseDirection,omitempty"`
|
||||
ArrayColumns []string `json:"arrayColumns,omitempty"`
|
||||
KeyColumns []string `json:"keyColumns,omitempty"`
|
||||
ValueColumn string `json:"valueColumn,omitempty"`
|
||||
}
|
6
modules/config/model/QueryInfo.go
Normal file
6
modules/config/model/QueryInfo.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package model
|
||||
|
||||
type QueryInfo struct {
|
||||
Query string `json:"query,omitempty"`
|
||||
Extend map[string]interface{} `json:"extend,omitempty"`
|
||||
}
|
5
modules/config/model/Schedule.go
Normal file
5
modules/config/model/Schedule.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package model
|
||||
|
||||
type Schedule struct {
|
||||
Interval string `json:"interval,omitempty"`
|
||||
}
|
6
modules/config/model/Target.go
Normal file
6
modules/config/model/Target.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package model
|
||||
|
||||
type Target struct {
|
||||
Auth map[string]interface{} `json:"auth,omitempty"`
|
||||
Connection *Connection `json:"connection,omitempty"`
|
||||
}
|
|
@ -1,9 +1,13 @@
|
|||
package probe
|
||||
|
||||
import (
|
||||
configM "git.loafle.net/overflow/overflow_commons_go/modules/config/model"
|
||||
)
|
||||
|
||||
type CrawlerService interface {
|
||||
Install()
|
||||
Uninstall()
|
||||
Update()
|
||||
|
||||
Authenticate()
|
||||
Authenticate(crawler *configM.Crawler, target *configM.Target) (bool, error)
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
package probe
|
||||
|
||||
type DiscoveryService interface {
|
||||
}
|
|
@ -1,9 +1,13 @@
|
|||
package probe
|
||||
|
||||
import (
|
||||
configM "git.loafle.net/overflow/overflow_commons_go/modules/config/model"
|
||||
)
|
||||
|
||||
type SensorService interface {
|
||||
Start()
|
||||
Stop()
|
||||
Add()
|
||||
Remove()
|
||||
Update()
|
||||
Start(id int64) (bool, error)
|
||||
Stop(id int64) (bool, error)
|
||||
Add(config *configM.Config) (bool, error)
|
||||
Remove(id int64) (bool, error)
|
||||
Update(id int64) (bool, error)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user