Move event types constants into single file
Move all constants for event types to types.go for easier code readability and maintainance. Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
@@ -27,7 +27,7 @@ func (s *Supervisor) updateContainer(t *UpdateTask) error {
|
||||
}
|
||||
s.notifySubscribers(Event{
|
||||
ID: t.ID,
|
||||
Type: "resume",
|
||||
Type: StateResume,
|
||||
Timestamp: time.Now(),
|
||||
})
|
||||
case runtime.Paused:
|
||||
@@ -36,7 +36,7 @@ func (s *Supervisor) updateContainer(t *UpdateTask) error {
|
||||
}
|
||||
s.notifySubscribers(Event{
|
||||
ID: t.ID,
|
||||
Type: "pause",
|
||||
Type: StatePause,
|
||||
Timestamp: time.Now(),
|
||||
})
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user