Code Review
/
src
/
xds
/
xds-agent.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed Syncthing folder status events and exec command.
[src/xds/xds-agent.git]
/
lib
/
agent
/
events.go
diff --git
a/lib/agent/events.go
b/lib/agent/events.go
index
24efc5a
..
e66f758
100644
(file)
--- a/
lib/agent/events.go
+++ b/
lib/agent/events.go
@@
-18,7
+18,7
@@
const (
EVTProjectChange = "project-state-change" // data type ProjectConfig
)
EVTProjectChange = "project-state-change" // data type ProjectConfig
)
-var EVTAllList = []string{
+var
_
EVTAllList = []string{
EVTServerConfig,
EVTProjectAdd,
EVTProjectDelete,
EVTServerConfig,
EVTProjectAdd,
EVTProjectDelete,
@@
-33,7
+33,6
@@
type EventMsg struct {
}
type EventDef struct {
}
type EventDef struct {
- // SEB cbs []EventsCB
sids map[string]int
}
sids map[string]int
}
@@
-45,7
+44,7
@@
type Events struct {
// NewEvents creates an instance of Events
func NewEvents(ctx *Context) *Events {
evMap := make(map[string]*EventDef)
// NewEvents creates an instance of Events
func NewEvents(ctx *Context) *Events {
evMap := make(map[string]*EventDef)
- for _, ev := range EVTAllList {
+ for _, ev := range
_
EVTAllList {
evMap[ev] = &EventDef{
sids: make(map[string]int),
}
evMap[ev] = &EventDef{
sids: make(map[string]int),
}
@@
-58,12
+57,12
@@
func NewEvents(ctx *Context) *Events {
// GetList returns the list of all supported events
func (e *Events) GetList() []string {
// GetList returns the list of all supported events
func (e *Events) GetList() []string {
- return EVTAllList
+ return
_
EVTAllList
}
// Register Used by a client/session to register to a specific (or all) event(s)
func (e *Events) Register(evName, sessionID string) error {
}
// Register Used by a client/session to register to a specific (or all) event(s)
func (e *Events) Register(evName, sessionID string) error {
- evs := EVTAllList
+ evs :=
_
EVTAllList
if evName != EVTAll {
if _, ok := e.eventsMap[evName]; !ok {
return fmt.Errorf("Unsupported event type name")
if evName != EVTAll {
if _, ok := e.eventsMap[evName]; !ok {
return fmt.Errorf("Unsupported event type name")
@@
-78,7
+77,7
@@
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 {
// UnRegister Used by a client/session to unregister event(s)
func (e *Events) UnRegister(evName, sessionID string) error {
- evs := EVTAllList
+ evs :=
_
EVTAllList
if evName != EVTAll {
if _, ok := e.eventsMap[evName]; !ok {
return fmt.Errorf("Unsupported event type name")
if evName != EVTAll {
if _, ok := e.eventsMap[evName]; !ok {
return fmt.Errorf("Unsupported event type name")
@@
-102,7
+101,9
@@
func (e *Events) Emit(evName string, data interface{}) error {
return fmt.Errorf("Unsupported event type")
}
return fmt.Errorf("Unsupported event type")
}
- e.Log.Debugf("Emit Event %s: %v", evName, data)
+ if e.LogLevelSilly {
+ e.Log.Debugf("Emit Event %s: %v", evName, data)
+ }
firstErr = nil
evm := e.eventsMap[evName]
firstErr = nil
evm := e.eventsMap[evName]