github.com/MaximeAubanel/moby@v1.13.1/client/plugin_push.go (about)

     1  package client
     2  
     3  import (
     4  	"io"
     5  
     6  	"golang.org/x/net/context"
     7  )
     8  
     9  // PluginPush pushes a plugin to a registry
    10  func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) {
    11  	headers := map[string][]string{"X-Registry-Auth": {registryAuth}}
    12  	resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers)
    13  	if err != nil {
    14  		return nil, err
    15  	}
    16  	return resp.body, nil
    17  }