diff options
author | Brian Goff <cpuguy83@gmail.com> | 2017-06-07 13:07:01 -0400 |
---|---|---|
committer | Brian Goff <cpuguy83@gmail.com> | 2017-07-06 14:26:06 -0400 |
commit | 72c3bcf2a533a827402945e3a55872e2db4fb024 (patch) | |
tree | 30dc1ceab65d65ac10037994de8bdb20e8a2b6ec /plugin/defs.go | |
parent | 9d95740dbfb790b3ea531a363697076ffb97a294 (diff) | |
download | docker-72c3bcf2a533a827402945e3a55872e2db4fb024.tar.gz |
Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).
This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Diffstat (limited to 'plugin/defs.go')
-rw-r--r-- | plugin/defs.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/defs.go b/plugin/defs.go index cf44c97ec8..3e930de048 100644 --- a/plugin/defs.go +++ b/plugin/defs.go @@ -24,3 +24,14 @@ func NewStore() *Store { handlers: make(map[string][]func(string, *plugins.Client)), } } + +// CreateOpt is used to configure specific plugin details when created +type CreateOpt func(p *v2.Plugin) + +// WithSwarmService is a CreateOpt that flags the passed in a plugin as a plugin +// managed by swarm +func WithSwarmService(id string) CreateOpt { + return func(p *v2.Plugin) { + p.SwarmServiceID = id + } +} |