diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 11:19:00 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-11-29 15:17:45 +0100 |
commit | 7c7d90a781082c6bd22d12a5e2451ca61a5198af (patch) | |
tree | 980c4ebea211b1a757343296debc39b3aa6b4859 /lib/agent/events.go | |
parent | b9239d295a7fb7e3f5c595887b3bf77d50c8b216 (diff) |
Renamed apiv1 lib to xaapiv1.
xa prefix (for Xds Agent) is safest to avoid confusion with xs prefix (for Xds Server)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/agent/events.go')
-rw-r--r-- | lib/agent/events.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/agent/events.go b/lib/agent/events.go index ccf8ddc..a45d404 100644 --- a/lib/agent/events.go +++ b/lib/agent/events.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/iotbzh/xds-agent/lib/apiv1" + "github.com/iotbzh/xds-agent/lib/xaapiv1" ) // EventDef Definition on one event @@ -21,7 +21,7 @@ type Events struct { // NewEvents creates an instance of Events func NewEvents(ctx *Context) *Events { evMap := make(map[string]*EventDef) - for _, ev := range apiv1.EVTAllList { + for _, ev := range xaapiv1.EVTAllList { evMap[ev] = &EventDef{ sids: make(map[string]int), } @@ -34,13 +34,13 @@ func NewEvents(ctx *Context) *Events { // GetList returns the list of all supported events func (e *Events) GetList() []string { - return apiv1.EVTAllList + return xaapiv1.EVTAllList } // Register Used by a client/session to register to a specific (or all) event(s) func (e *Events) Register(evName, sessionID string) error { - evs := apiv1.EVTAllList - if evName != apiv1.EVTAll { + evs := xaapiv1.EVTAllList + if evName != xaapiv1.EVTAll { if _, ok := e.eventsMap[evName]; !ok { return fmt.Errorf("Unsupported event type name") } @@ -54,8 +54,8 @@ func (e *Events) Register(evName, sessionID string) error { // UnRegister Used by a client/session to unregister event(s) func (e *Events) UnRegister(evName, sessionID string) error { - evs := apiv1.EVTAllList - if evName != apiv1.EVTAll { + evs := xaapiv1.EVTAllList + if evName != xaapiv1.EVTAll { if _, ok := e.eventsMap[evName]; !ok { return fmt.Errorf("Unsupported event type name") } @@ -92,7 +92,7 @@ func (e *Events) Emit(evName string, data interface{},fromSid string) error { } continue } - msg := apiv1.EventMsg{ + msg := xaapiv1.EventMsg{ Time: time.Now().String(), FromSessionID: fromSid, Type: evName, |