Skip to content
Snippets Groups Projects

Resolve "To improve the device watching mechanism a fetch all after time interval method should be implemented"

4 files
+ 37
31
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 9
9
@@ -4,10 +4,10 @@ import "github.com/google/uuid"
@@ -4,10 +4,10 @@ import "github.com/google/uuid"
// Event is a event that can be published via the event service as payload.
// Event is a event that can be published via the event service as payload.
type Event struct {
type Event struct {
ID uuid.UUID `json:"id,omitempty"`
ID uuid.UUID `json:"id,omitempty"`
EntityID uuid.UUID `json:"entity_id,omitempty"`
EntityID uuid.UUID `json:"entity_id,omitempty"`
Type string `json:"type,omitempty"`
Type string `json:"type,omitempty"`
Paths []string `json:"paths,omitempty"`
PathsAndValuesMap map[string]string `json:"paths_and_values,omitempty"`
}
}
const (
const (
@@ -49,11 +49,11 @@ func NewUpdateEvent(entityID uuid.UUID) Event {
@@ -49,11 +49,11 @@ func NewUpdateEvent(entityID uuid.UUID) Event {
}
}
// NewMneUpdateEvent creates a new update event for managed network elements.
// NewMneUpdateEvent creates a new update event for managed network elements.
func NewMneUpdateEvent(entityID uuid.UUID, paths []string) Event {
func NewMneUpdateEvent(entityID uuid.UUID, pathsAndValues map[string]string) Event {
return Event{
return Event{
ID: uuid.New(),
ID: uuid.New(),
EntityID: entityID,
EntityID: entityID,
Type: TypeUpdate,
Type: TypeUpdate,
Paths: paths,
PathsAndValuesMap: pathsAndValues,
}
}
}
}
Loading