const added
This commit is contained in:
parent
0afdad9d81
commit
6aeb8743ca
8
messages/agent.go
Normal file
8
messages/agent.go
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
package messages
|
||||||
|
|
||||||
|
const (
|
||||||
|
AGT_STARTING = "AGT_STARTING"
|
||||||
|
AGT_WILL_STOP = "AGENT_WILL_STOP"
|
||||||
|
AGT_STOPPED = "AGENT_STOPPED"
|
||||||
|
AGT_INITIALIZED = "AGT_INITIALIZED"
|
||||||
|
)
|
10
messages/crawler_manager.go
Normal file
10
messages/crawler_manager.go
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package messages
|
||||||
|
|
||||||
|
const (
|
||||||
|
CRM_READY = "CRAWLER_READY"
|
||||||
|
CRM_STOPPED = "CRAWLER_STOPPED"
|
||||||
|
CRM_SENSOR_ADD_DONE = "CRAWLER_SENSOR_ADD_DONE"
|
||||||
|
CRM_SENSOR_REMOVE_DONE = "CRAWLER_SENSOR_REMOVE_DONE"
|
||||||
|
CRM_SENSOR_UPDATE_DONE = "CRAWLER_SENSOR_UPDATE_DONE"
|
||||||
|
CRM_UPDATE_DONE = "CRAWLER_UPDATE_DONE"
|
||||||
|
)
|
14
messages/poller.go
Normal file
14
messages/poller.go
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package messages
|
||||||
|
|
||||||
|
const (
|
||||||
|
TASK_SENSOR_START = "TASK_SENSOR_START"
|
||||||
|
TASK_SENSOR_STOP = "TASK_SENSOR_STOP"
|
||||||
|
TASK_SENSOR_ADD = "TASK_SENSOR_ADD"
|
||||||
|
TASK_SENSOR_REMOVE = "TASK_SENSOR_REMOVE"
|
||||||
|
TASK_SENSOR_UPDATE = "TASK_SENSOR_UPDATE"
|
||||||
|
TASK_CRAWLER_UPDATE = "TASK_CRAWLER_UPDATE"
|
||||||
|
TASK_AGENT_UPDATE = "TASK_AGENT_UPDATE"
|
||||||
|
TASK_LOG_SEND = "TASK_LOG_SEND"
|
||||||
|
TASK_DONE = "TASK_DONE"
|
||||||
|
TASK_POLLER_INTERVAL_UPDATE = "TASK_POLLER_INTERVAL_UPDATE"
|
||||||
|
)
|
|
@ -4,4 +4,3 @@ const (
|
||||||
QUEUE_DATA = "QUEUE_DATA"
|
QUEUE_DATA = "QUEUE_DATA"
|
||||||
QUEUE_EVENT = "QUEUE_EVENT"
|
QUEUE_EVENT = "QUEUE_EVENT"
|
||||||
)
|
)
|
||||||
|
|
6
messages/task.go
Normal file
6
messages/task.go
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
package messages
|
||||||
|
|
||||||
|
type AgentTask struct {
|
||||||
|
Command string
|
||||||
|
Params map[string]string
|
||||||
|
}
|
|
@ -1,8 +0,0 @@
|
||||||
package messages
|
|
||||||
|
|
||||||
const (
|
|
||||||
AGT_STARTING = "AGT_STARTING"
|
|
||||||
AGT_WILL_STOP = "AGENT_WILL_STOP"
|
|
||||||
AGT_STOPPED = "AGENT_STOPPED"
|
|
||||||
AGT_INITIALIZED = "AGT_INITIALIZED"
|
|
||||||
)
|
|
|
@ -1,12 +0,0 @@
|
||||||
package messages
|
|
||||||
|
|
||||||
|
|
||||||
const (
|
|
||||||
CRM_READY = "CRAWLER_READY"
|
|
||||||
CRM_STOPPED = "CRAWLER_STOPPED"
|
|
||||||
CRM_SENSOR_ADD_DONE = "CRAWLER_SENSOR_ADD_DONE"
|
|
||||||
CRM_SENSOR_REMOVE_DONE = "CRAWLER_SENSOR_REMOVE_DONE"
|
|
||||||
CRM_SENSOR_UPDATE_DONE = "CRAWLER_SENSOR_UPDATE_DONE"
|
|
||||||
CRM_UPDATE_DONE = "CRAWLER_UPDATE_DONE"
|
|
||||||
|
|
||||||
)
|
|
|
@ -1,14 +0,0 @@
|
||||||
package messages
|
|
||||||
|
|
||||||
const (
|
|
||||||
TASK_SENSOR_START = "TASK_SENSOR_START"
|
|
||||||
TASK_SENSOR_STOP = "TASK_SENSOR_STOP"
|
|
||||||
TASK_SENSOR_ADD = "TASK_SENSOR_ADD"
|
|
||||||
TASK_SENSOR_REMOVE = "TASK_SENSOR_REMOVE"
|
|
||||||
TASK_SENSOR_UPDATE = "TASK_SENSOR_UPDATE"
|
|
||||||
TASK_CRAWLER_UPDATE = "TASK_CRAWLER_UPDATE"
|
|
||||||
TASK_AGENT_UPDATE = "TASK_AGENT_UPDATE"
|
|
||||||
TASK_LOG_SEND = "TASK_LOG_SEND"
|
|
||||||
TASK_DONE = "TASK_DONE"
|
|
||||||
TASK_POLLER_INTERVAL_UPDATE = "TASK_POLLER_INTERVAL_UPDATE"
|
|
||||||
)
|
|
|
@ -1,11 +1,11 @@
|
||||||
package observer
|
package observer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"loafle.com/overflow/agent_api/messages"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
"loafle.com/overflow/agent_api/observer/messages"
|
|
||||||
"fmt"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Test struct {
|
type Test struct {
|
||||||
|
@ -98,7 +98,6 @@ func TestMultiAddObserver(t *testing.T) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestStringNotify(t *testing.T) {
|
func TestStringNotify(t *testing.T) {
|
||||||
ch := make(chan interface{}, 0)
|
ch := make(chan interface{}, 0)
|
||||||
Add("test", ch)
|
Add("test", ch)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user