Move Container and runtime to plugin pkg

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-05-11 15:24:12 -07:00
parent fa4e114979
commit 01b9f5ec67
10 changed files with 63 additions and 61 deletions

View File

@@ -5,9 +5,9 @@ import "github.com/containerd/containerd"
// ContainerMonitor provides an interface for monitoring of containers within containerd
type ContainerMonitor interface {
// Monitor adds the provided container to the monitor
Monitor(containerd.Container) error
Monitor(Container) error
// Stop stops and removes the provided container from the monitor
Stop(containerd.Container) error
Stop(Container) error
// Events emits events from the monitor
Events(chan<- *containerd.Event)
}
@@ -25,11 +25,11 @@ func NewNoopMonitor() ContainerMonitor {
type noopContainerMonitor struct {
}
func (mm *noopContainerMonitor) Monitor(c containerd.Container) error {
func (mm *noopContainerMonitor) Monitor(c Container) error {
return nil
}
func (mm *noopContainerMonitor) Stop(c containerd.Container) error {
func (mm *noopContainerMonitor) Stop(c Container) error {
return nil
}
@@ -40,7 +40,7 @@ type multiContainerMonitor struct {
monitors []ContainerMonitor
}
func (mm *multiContainerMonitor) Monitor(c containerd.Container) error {
func (mm *multiContainerMonitor) Monitor(c Container) error {
for _, m := range mm.monitors {
if err := m.Monitor(c); err != nil {
return err
@@ -49,7 +49,7 @@ func (mm *multiContainerMonitor) Monitor(c containerd.Container) error {
return nil
}
func (mm *multiContainerMonitor) Stop(c containerd.Container) error {
func (mm *multiContainerMonitor) Stop(c Container) error {
for _, m := range mm.monitors {
if err := m.Stop(c); err != nil {
return err