github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/client/plugin_push.go (about)

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