Skip to content
Snippets Groups Projects

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

Files
5
+ 14
3
@@ -4,9 +4,10 @@ import "github.com/google/uuid"
@@ -4,9 +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"`
 
PathsAndValuesMap map[string]string `json:"paths_and_values,omitempty"`
}
}
const (
const (
@@ -46,3 +47,13 @@ func NewUpdateEvent(entityID uuid.UUID) Event {
@@ -46,3 +47,13 @@ func NewUpdateEvent(entityID uuid.UUID) Event {
Type: TypeUpdate,
Type: TypeUpdate,
}
}
}
}
 
 
// NewMneUpdateEvent creates a new update event for managed network elements.
 
func NewMneUpdateEvent(entityID uuid.UUID, pathsAndValues map[string]string) Event {
 
return Event{
 
ID: uuid.New(),
 
EntityID: entityID,
 
Type: TypeUpdate,
 
PathsAndValuesMap: pathsAndValues,
 
}
 
}
Loading