This commit is contained in:
crusader 2018-04-26 16:37:59 +09:00
parent 2eb0a778e0
commit 9f8fd87eca
80 changed files with 164 additions and 90 deletions

View File

@ -1,4 +1,4 @@
package config package external
type External struct { type External struct {
GRPC *GRPC `json:"grpc,omitempty"` GRPC *GRPC `json:"grpc,omitempty"`

View File

@ -1,4 +1,4 @@
package config package external
type GRPC struct { type GRPC struct {
Network string `json:"network,omitempty"` Network string `json:"network,omitempty"`

View File

@ -1,4 +1,4 @@
package config package external
type Kafka struct { type Kafka struct {
Network string `json:"network,omitempty"` Network string `json:"network,omitempty"`

View File

@ -1,4 +1,4 @@
package config package external
type Redis struct { type Redis struct {
Network string `json:"network,omitempty"` Network string `json:"network,omitempty"`

View File

@ -1,4 +1,4 @@
package config package noauthprobe
import "time" import "time"

View File

@ -1,4 +1,4 @@
package constants package noauthprobe
const ( const (
ConfigFileName = "auth.json" ConfigFileName = "auth.json"

View File

@ -1,4 +1,4 @@
package constants package noauthprobe
const ( const (
HTTPEntry_Auth = "/auth" HTTPEntry_Auth = "/auth"

View File

@ -1,4 +1,4 @@
package config package probe
type Account struct { type Account struct {
Name string `required:"true" json:"name,omitempty"` Name string `required:"true" json:"name,omitempty"`

View File

@ -1,4 +1,4 @@
package config package probe
import ( import (
csswc "git.loafle.net/commons/server-go/socket/web/client" csswc "git.loafle.net/commons/server-go/socket/web/client"

View File

@ -1,4 +1,4 @@
package constants package probe
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package constants package probe
const ( const (
ConfigFileName = "config.json" ConfigFileName = "config.json"

View File

@ -1,4 +1,4 @@
package config package probe
type ProbeStateType int type ProbeStateType int

View File

@ -1,4 +1,4 @@
package constants package probe
const ( const (
HTTPEntry_Probe = "/probe" HTTPEntry_Probe = "/probe"

View File

@ -1,4 +1,4 @@
package model package discovery
type DiscoveryHost struct { type DiscoveryHost struct {
FirstScanRange string `json:"firstScanRange,omitempty"` FirstScanRange string `json:"firstScanRange,omitempty"`

View File

@ -1,4 +1,4 @@
package model package discovery
type DiscoveryPort struct { type DiscoveryPort struct {
FirstScanRange int `json:"firstScanRange,omitempty"` FirstScanRange int `json:"firstScanRange,omitempty"`

View File

@ -1,4 +1,4 @@
package model package discovery
type DiscoveryService struct { type DiscoveryService struct {
IncludeServices []string `json:"includeServices,omitempty"` IncludeServices []string `json:"includeServices,omitempty"`

View File

@ -1,4 +1,4 @@
package model package discovery
type DiscoveryZone struct { type DiscoveryZone struct {
ExcludePatterns []string `json:"excludePatterns,omitempty"` ExcludePatterns []string `json:"excludePatterns,omitempty"`

View File

@ -1,4 +1,4 @@
package model package discovery
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package discovery
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package discovery
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package discovery
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package domain
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,10 +1,10 @@
package model package domain
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
member "git.loafle.net/overflow/commons-go/member/model" "git.loafle.net/overflow/commons-go/model/member"
) )
type DomainMember struct { type DomainMember struct {

View File

@ -1,12 +1,12 @@
package model package infra
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
probe "git.loafle.net/overflow/commons-go/probe/model" "git.loafle.net/overflow/commons-go/model/probe"
target "git.loafle.net/overflow/commons-go/target/model" "git.loafle.net/overflow/commons-go/model/target"
) )
type Infra struct { type Infra struct {

View File

@ -1,4 +1,4 @@
package model package infra
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package infra
import "git.loafle.net/overflow/commons-go/core/util" import "git.loafle.net/overflow/commons-go/core/util"

View File

@ -1,8 +1,8 @@
package model package infra
import ( import (
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type InfraOS struct { type InfraOS struct {

View File

@ -1,4 +1,4 @@
package model package infra
import "git.loafle.net/overflow/commons-go/core/util" import "git.loafle.net/overflow/commons-go/core/util"

View File

@ -1,4 +1,4 @@
package model package infra
import ( import (
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"

View File

@ -1,10 +1,10 @@
package model package infra
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type InfraOSPort struct { type InfraOSPort struct {

View File

@ -1,10 +1,10 @@
package model package infra
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type InfraServiceApplication struct { type InfraServiceApplication struct {

View File

@ -1,10 +1,10 @@
package model package member
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type Member struct { type Member struct {

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package meta
import "encoding/json" import "encoding/json"

View File

@ -1,12 +1,12 @@
package model package noauthprobe
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
domain "git.loafle.net/overflow/commons-go/domain/model" "git.loafle.net/overflow/commons-go/model/domain"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
probe "git.loafle.net/overflow/commons-go/probe/model" "git.loafle.net/overflow/commons-go/model/probe"
) )
type NoAuthProbe struct { type NoAuthProbe struct {

View File

@ -1,4 +1,4 @@
package model package noauthprobe
type NoAuthProbeDescription struct { type NoAuthProbeDescription struct {
Host *NoAuthProbeDescriptionHost `json:"host,omitempty"` Host *NoAuthProbeDescriptionHost `json:"host,omitempty"`

View File

@ -1,4 +1,4 @@
package model package noauthprobe
type NoAuthProbeDescriptionHost struct { type NoAuthProbeDescriptionHost struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`

View File

@ -1,4 +1,4 @@
package model package noauthprobe
type NoAuthProbeDescriptionNetwork struct { type NoAuthProbeDescriptionNetwork struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`

View File

@ -1,10 +1,10 @@
package model package notification
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
member "git.loafle.net/overflow/commons-go/member/model" "git.loafle.net/overflow/commons-go/model/member"
) )
type Notification struct { type Notification struct {

View File

@ -1,12 +1,12 @@
package model package probe
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
domain "git.loafle.net/overflow/commons-go/domain/model" "git.loafle.net/overflow/commons-go/model/domain"
member "git.loafle.net/overflow/commons-go/member/model" "git.loafle.net/overflow/commons-go/model/member"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type Probe struct { type Probe struct {

View File

@ -1,10 +1,10 @@
package model package probe
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type ProbeTask struct { type ProbeTask struct {

View File

@ -1,11 +1,11 @@
package model package sensor
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
target "git.loafle.net/overflow/commons-go/target/model" "git.loafle.net/overflow/commons-go/model/target"
) )
type Sensor struct { type Sensor struct {

View File

@ -1,10 +1,10 @@
package model package sensor
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/commons-go/core/util" "git.loafle.net/overflow/commons-go/core/util"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type SensorItem struct { type SensorItem struct {

View File

@ -1,9 +1,9 @@
package model package sensor
import ( import (
"encoding/json" "encoding/json"
meta "git.loafle.net/overflow/commons-go/meta/model" "git.loafle.net/overflow/commons-go/model/meta"
) )
type SensorItemDependency struct { type SensorItemDependency struct {

View File

@ -1,4 +1,4 @@
package model package sensorconfig
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type Crawler struct { type Crawler struct {
Name string `json:"name,omitempty"` Name string `json:"name,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type Item struct { type Item struct {
Keys []Keys `json:"keys,omitempty"` Keys []Keys `json:"keys,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type Keys struct { type Keys struct {
Metric string `json:"metric,omitempty"` Metric string `json:"metric,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type MappingInfo struct { type MappingInfo struct {
ParseDirection string `json:"parseDirection,omitempty"` ParseDirection string `json:"parseDirection,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type QueryInfo struct { type QueryInfo struct {
Query string `json:"query,omitempty"` Query string `json:"query,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package sensorconfig
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package sensorconfig
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type Schedule struct { type Schedule struct {
Interval string `json:"interval,omitempty"` Interval string `json:"interval,omitempty"`

View File

@ -1,4 +1,4 @@
package model package sensorconfig
import "encoding/json" import "encoding/json"

View File

@ -1,4 +1,4 @@
package model package sensorconfig
type Target struct { type Target struct {
Auth map[string]interface{} `json:"auth,omitempty"` Auth map[string]interface{} `json:"auth,omitempty"`

View File

@ -1,4 +1,4 @@
package model package target
import ( import (
"encoding/json" "encoding/json"

View File

@ -0,0 +1,6 @@
package container
type CrawlerService interface {
Auth(crawlerName string, auth map[string]interface{}) error
Get(sensorConfigID string) (map[string]string, error)
}

View File

@ -0,0 +1,4 @@
package container
type ProbeService interface {
}

View File

@ -0,0 +1,10 @@
package container
import "git.loafle.net/overflow/commons-go/model/sensorconfig"
type SensorConfigService interface {
InitConfig(sensorConfigs []*sensorconfig.SensorConfig) error
AddConfig(sensorConfig *sensorconfig.SensorConfig) error
UpdateConfig(sensorConfig *sensorconfig.SensorConfig) error
RemoveConfig(sensorConfigID string) error
}

View File

@ -0,0 +1,11 @@
package discovery
import "git.loafle.net/overflow/commons-go/model/discovery"
type DiscoveryService interface {
DiscoverZone(requesterID string, dz *discovery.DiscoveryZone) error
DiscoverHost(requesterID string, zone *discovery.Zone, dh *discovery.DiscoveryHost) error
DiscoverPort(requesterID string, host *discovery.Host, dp *discovery.DiscoveryPort) error
DiscoverService(requesterID string, port *discovery.Port, ds *discovery.DiscoveryService) error
StopRequest(requesterID string) error
}

View File

@ -0,0 +1,4 @@
package probe
type CollectorService interface {
}

View File

@ -0,0 +1,4 @@
package probe
type ContainerService interface {
}

View File

@ -0,0 +1,4 @@
package probe
type CrawlerService interface {
}

View File

@ -0,0 +1,4 @@
package probe
type DataClientService interface {
}

View File

@ -0,0 +1,21 @@
package probe
import (
"git.loafle.net/overflow/commons-go/core/util"
"git.loafle.net/overflow/commons-go/model/discovery"
)
type DiscoveryService interface {
// By Central
DiscoverZone(requesterID string, dz *discovery.DiscoveryZone) error
DiscoverHost(requesterID string, zone *discovery.Zone, dh *discovery.DiscoveryHost) error
DiscoverPort(requesterID string, host *discovery.Host, dp *discovery.DiscoveryPort) error
DiscoverService(requesterID string, port *discovery.Port, dService *discovery.DiscoveryService) error
// By Container
DiscoveryStart(requesterID string, t *util.Timestamp) error
DiscoveryStop(requesterID string, t *util.Timestamp) error
DiscoveredZone(requesterID string, zone *discovery.Zone) error
DiscoveredHost(requesterID string, host *discovery.Host) error
DiscoveredPort(requesterID string, port *discovery.Port) error
DiscoveredService(requesterID string, service *discovery.Service) error
}

View File

@ -0,0 +1,6 @@
package probe
type SensorConfigService interface {
AddConfig(tempFilePath string) error
RemoveConfig(sensorConfigID string) error
}