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 {
GRPC *GRPC `json:"grpc,omitempty"`

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,10 @@
package model
package domain
import (
"encoding/json"
"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 {

View File

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

View File

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

View File

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

View File

@ -1,8 +1,8 @@
package model
package infra
import (
"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 {

View File

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

View File

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

View File

@ -1,10 +1,10 @@
package model
package infra
import (
"encoding/json"
"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 {

View File

@ -1,10 +1,10 @@
package model
package infra
import (
"encoding/json"
"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 {

View File

@ -1,10 +1,10 @@
package model
package member
import (
"encoding/json"
"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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,10 @@
package model
package notification
import (
"encoding/json"
"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 {

View File

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

View File

@ -1,10 +1,10 @@
package model
package probe
import (
"encoding/json"
"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 {

View File

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

View File

@ -1,10 +1,10 @@
package model
package sensor
import (
"encoding/json"
"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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
package model
package target
import (
"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
}