plugin_inspect.go 475 B

12345678910111213141516171819202122
  1. // +build experimental
  2. package client
  3. import (
  4. "encoding/json"
  5. "github.com/docker/engine-api/types"
  6. "golang.org/x/net/context"
  7. )
  8. // PluginInspect inspects an existing plugin
  9. func (cli *Client) PluginInspect(ctx context.Context, name string) (*types.Plugin, error) {
  10. var p types.Plugin
  11. resp, err := cli.get(ctx, "/plugins/"+name, nil, nil)
  12. if err != nil {
  13. return nil, err
  14. }
  15. err = json.NewDecoder(resp.body).Decode(&p)
  16. ensureReaderClosed(resp)
  17. return &p, err
  18. }