github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/client/plugin_push.go (about)

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