From 9d1ebadbba5ae338021dee83d76fad9041ac4ca5 Mon Sep 17 00:00:00 2001 From: "insanity@loafle.com" Date: Tue, 16 May 2017 17:05:37 +0900 Subject: [PATCH] const --- messages/agent.go | 6 ------ messages/collector.go | 10 ---------- messages/config_manager.go | 15 --------------- messages/{poller.go => const.go} | 3 +++ messages/crawler.go | 6 ------ messages/crawler_manager.go | 10 ---------- messages/data.go | 9 +++++++++ messages/data_sender.go | 5 ----- messages/event.go | 7 +++++++ messages/event_sender.go | 5 ----- messages/queue.go | 6 ------ messages/task.go | 6 ------ 12 files changed, 19 insertions(+), 69 deletions(-) delete mode 100644 messages/agent.go delete mode 100644 messages/collector.go delete mode 100644 messages/config_manager.go rename messages/{poller.go => const.go} (90%) delete mode 100644 messages/crawler.go delete mode 100644 messages/crawler_manager.go create mode 100644 messages/data.go delete mode 100644 messages/data_sender.go create mode 100644 messages/event.go delete mode 100644 messages/event_sender.go delete mode 100644 messages/queue.go diff --git a/messages/agent.go b/messages/agent.go deleted file mode 100644 index 116b0da..0000000 --- a/messages/agent.go +++ /dev/null @@ -1,6 +0,0 @@ -package messages - -const ( - AGT_START = "AGENTT_START" - AGT_STOP = "AGENT_STOP" -) diff --git a/messages/collector.go b/messages/collector.go deleted file mode 100644 index cf40101..0000000 --- a/messages/collector.go +++ /dev/null @@ -1,10 +0,0 @@ -package messages - -const ( - CLT_READY = "COLLECTOR_READY" - CLT_STOPPED = "COLLECTOR_STOPPED" - CLT_SENSOR_REMOVE_DONE = "COLLECTOR_SENSOR_REMOVE_DONE" - CLT_SENSOR_UPDATE_DONE = "COLLECTOR_SENSOR_UPDATE_DONE" - CLT_CRM_UPDATE_DONE = "COLLECTOR_CRAWLER_UPDATE_DONE" - CLT_DATA_SEND = "DATA_SEND" -) diff --git a/messages/config_manager.go b/messages/config_manager.go deleted file mode 100644 index faea971..0000000 --- a/messages/config_manager.go +++ /dev/null @@ -1,15 +0,0 @@ -package messages - -const ( - //CONFIGMANAGER_LOADED = "CONFIGMANAGER_LOADED" - //ADD_SENSOR_1 = "ADD_SENSOR_1" - //REMOVE_SENSOR_1 = "REMOVE_SENSOR_1" - - CFG_LOADED = "CONFIG_LOADED" - - SCF_READY = "SENSOR_CONFIG_READY" - SCF_STOPPED = "SENSOR_CONFIG_STOPPED" - SCF_SENSOR_ADD_DONE = "SENSOR_CONFIG_SENSOR_ADD_DONE" - - SCF_SENSOR_UPDATE_DONE = "SENSOR_CONFIG_SENSOR_UPDATE_DONE" -) diff --git a/messages/poller.go b/messages/const.go similarity index 90% rename from messages/poller.go rename to messages/const.go index 9942846..789d4c8 100644 --- a/messages/poller.go +++ b/messages/const.go @@ -1,6 +1,9 @@ package messages const ( + AGT_START = "AGENT_START" + AGT_STOP = "AGENT_STOP" + TASK_SENSOR_START = "TASK_SENSOR_START" TASK_SENSOR_STOP = "TASK_SENSOR_STOP" TASK_SENSOR_ADD = "TASK_SENSOR_ADD" diff --git a/messages/crawler.go b/messages/crawler.go deleted file mode 100644 index 46508ed..0000000 --- a/messages/crawler.go +++ /dev/null @@ -1,6 +0,0 @@ -package messages - -const ( - CRAWLER_ADD = "CRAWLER_ADD" - CRAWLER_REMOVE = "CRAWLER_REMOVE" -) diff --git a/messages/crawler_manager.go b/messages/crawler_manager.go deleted file mode 100644 index 907191b..0000000 --- a/messages/crawler_manager.go +++ /dev/null @@ -1,10 +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" -) diff --git a/messages/data.go b/messages/data.go new file mode 100644 index 0000000..b2cf1ff --- /dev/null +++ b/messages/data.go @@ -0,0 +1,9 @@ +package messages + +type Data struct { + AgentId string + SensorId string + Data []byte + StartedAt uint64 + FinishedAt uint64 +} diff --git a/messages/data_sender.go b/messages/data_sender.go deleted file mode 100644 index 9ddc558..0000000 --- a/messages/data_sender.go +++ /dev/null @@ -1,5 +0,0 @@ -package messages - -const ( - DATA_SEND = "DATA_SEND" -) diff --git a/messages/event.go b/messages/event.go new file mode 100644 index 0000000..175838d --- /dev/null +++ b/messages/event.go @@ -0,0 +1,7 @@ +package messages + +type Event struct { + Type string + Id string + Data []byte +} diff --git a/messages/event_sender.go b/messages/event_sender.go deleted file mode 100644 index b8ecd6a..0000000 --- a/messages/event_sender.go +++ /dev/null @@ -1,5 +0,0 @@ -package messages - -const ( - EVENT_ERROR = "EVENT_ERROR" -) diff --git a/messages/queue.go b/messages/queue.go deleted file mode 100644 index df43c0b..0000000 --- a/messages/queue.go +++ /dev/null @@ -1,6 +0,0 @@ -package messages - -const ( - QUEUE_DATA = "QUEUE_DATA" - QUEUE_EVENT = "QUEUE_EVENT" -) diff --git a/messages/task.go b/messages/task.go index 2689f66..daf7773 100644 --- a/messages/task.go +++ b/messages/task.go @@ -4,9 +4,3 @@ type AgentTask struct { Command string Params map[string]string } - -type TaskResult struct { - Command string - Success bool - Err error -}