github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/daemon/cluster/controllers/plugin/controller.go (about) 1 package plugin 2 3 import ( 4 "github.com/Sirupsen/logrus" 5 "github.com/docker/swarmkit/api" 6 "golang.org/x/net/context" 7 ) 8 9 // Controller is the controller for the plugin backend 10 type Controller struct{} 11 12 // NewController returns a new cluster plugin controller 13 func NewController() (*Controller, error) { 14 return &Controller{}, nil 15 } 16 17 // Update is the update phase from swarmkit 18 func (p *Controller) Update(ctx context.Context, t *api.Task) error { 19 logrus.WithFields(logrus.Fields{ 20 "controller": "plugin", 21 }).Debug("Update") 22 return nil 23 } 24 25 // Prepare is the prepare phase from swarmkit 26 func (p *Controller) Prepare(ctx context.Context) error { 27 logrus.WithFields(logrus.Fields{ 28 "controller": "plugin", 29 }).Debug("Prepare") 30 return nil 31 } 32 33 // Start is the start phase from swarmkit 34 func (p *Controller) Start(ctx context.Context) error { 35 logrus.WithFields(logrus.Fields{ 36 "controller": "plugin", 37 }).Debug("Start") 38 return nil 39 } 40 41 // Wait causes the task to wait until returned 42 func (p *Controller) Wait(ctx context.Context) error { 43 logrus.WithFields(logrus.Fields{ 44 "controller": "plugin", 45 }).Debug("Wait") 46 return nil 47 } 48 49 // Shutdown is the shutdown phase from swarmkit 50 func (p *Controller) Shutdown(ctx context.Context) error { 51 logrus.WithFields(logrus.Fields{ 52 "controller": "plugin", 53 }).Debug("Shutdown") 54 return nil 55 } 56 57 // Terminate is the terminate phase from swarmkit 58 func (p *Controller) Terminate(ctx context.Context) error { 59 logrus.WithFields(logrus.Fields{ 60 "controller": "plugin", 61 }).Debug("Terminate") 62 return nil 63 } 64 65 // Remove is the remove phase from swarmkit 66 func (p *Controller) Remove(ctx context.Context) error { 67 logrus.WithFields(logrus.Fields{ 68 "controller": "plugin", 69 }).Debug("Remove") 70 return nil 71 } 72 73 // Close is the close phase from swarmkit 74 func (p *Controller) Close() error { 75 logrus.WithFields(logrus.Fields{ 76 "controller": "plugin", 77 }).Debug("Close") 78 return nil 79 }