69f8f566a2
It allows to keep main namespace cleaner Signed-off-by: Alexander Morozov <lk4d4@docker.com>
25 lines
497 B
Go
25 lines
497 B
Go
package supervisor
|
|
|
|
type CreateCheckpointEvent struct {
|
|
s *Supervisor
|
|
}
|
|
|
|
func (h *CreateCheckpointEvent) Handle(e *Event) error {
|
|
i, ok := h.s.containers[e.ID]
|
|
if !ok {
|
|
return ErrContainerNotFound
|
|
}
|
|
return i.container.Checkpoint(*e.Checkpoint)
|
|
}
|
|
|
|
type DeleteCheckpointEvent struct {
|
|
s *Supervisor
|
|
}
|
|
|
|
func (h *DeleteCheckpointEvent) Handle(e *Event) error {
|
|
i, ok := h.s.containers[e.ID]
|
|
if !ok {
|
|
return ErrContainerNotFound
|
|
}
|
|
return i.container.DeleteCheckpoint(e.Checkpoint.Name)
|
|
}
|