const added

This commit is contained in:
insanity@loafle.com 2017-05-15 18:19:37 +09:00
parent 0afdad9d81
commit 6aeb8743ca
14 changed files with 79 additions and 77 deletions

8
messages/agent.go Normal file
View 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"
)

View 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
View 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"
)

View File

@ -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
View File

@ -0,0 +1,6 @@
package messages
type AgentTask struct {
Command string
Params map[string]string
}

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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)