{"modulePath":"github.com/jenspinney/cli","version":"v6.42.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is a client that can be used to make HTTP requests to plugin repositories.\n\n```go\nfunc NewClient(config Config) *Client\n```\nNewClient returns a new plugin Client.\n\n```go\nfunc (client *Client) DownloadPlugin(pluginURL string, path string, proxyReader ProxyReader) error\n```\n\n```go\nfunc (client *Client) GetPluginRepository(repositoryURL string) (PluginRepository, error)\n```\n\n```go\nfunc (client *Client) WrapConnection(wrapper ConnectionWrapper)\n```\nWrapConnection wraps the current Client connection in the wrapper.\n\n```go\ntype Config struct {\n\t// AppName is the name of the application/process using the client.\n\tAppName string\n\n\t// AppVersion is the version of the application/process using the client.\n\tAppVersion string\n\n\t// DialTimeout is the DNS lookup timeout for the client. If not set, it is\n\t// infinite.\n\tDialTimeout time.Duration\n\n\t// SkipSSLValidation controls whether a client verifies the server's\n\t// certificate chain and host name. If SkipSSLValidation is true, TLS accepts\n\t// any certificate presented by the server and any host name in that\n\t// certificate for *all* client requests going forward.\n\t//\n\t// In this mode, TLS is susceptible to man-in-the-middle attacks. This should\n\t// be used only for testing.\n\tSkipSSLValidation bool\n}\n```\nConfig allows the Client to be configured\n\n```go\ntype Connection interface {\n\tMake(request *http.Request, passedResponse *Response, proxyReader ProxyReader) error\n}\n```\nConnection creates and executes http requests\n\n```go\ntype ConnectionWrapper interface {\n\tConnection\n\tWrap(innerconnection Connection) Connection\n}\n```\nConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.\n\n```go\ntype Plugin struct {\n\tName        string         `json:\"name\"`\n\tDescription string         `json:\"description\"`\n\tVersion     string         `json:\"version\"`\n\tBinaries    []PluginBinary `json:\"binaries\"`\n}\n```\n\n```go\ntype PluginBinary struct {\n\tPlatform string `json:\"platform\"`\n\tURL      string `json:\"url\"`\n\tChecksum string `json:\"checksum\"`\n}\n```\n\n```go\ntype PluginConnection struct {\n\tHTTPClient *http.Client\n\t// contains filtered or unexported fields\n}\n```\nPluginConnection represents a connection to a plugin repo.\n\n```go\nfunc NewConnection(skipSSLValidation bool, dialTimeout time.Duration) *PluginConnection\n```\nNewConnection returns a new PluginConnection\n\n```go\nfunc (connection *PluginConnection) Make(request *http.Request, passedResponse *Response, proxyReader ProxyReader) error\n```\nMake performs the request and parses the response.\n\n```go\ntype PluginRepository struct {\n\tPlugins []Plugin `json:\"plugins\"`\n}\n```\nPluginRepository represents a plugin repository\n\n```go\ntype ProxyReader interface {\n\tWrap(io.Reader) io.ReadCloser\n\tStart(int64)\n\tFinish()\n}\n```\n\n```go\ntype Response struct {\n\t// Result represents the type that is expected in the\n\t// response JSON.\n\tResult interface{}\n\n\t// RawResponse represents the response body.\n\tRawResponse []byte\n\n\t// HTTPResponse represents the HTTP response object.\n\tHTTPResponse *http.Response\n}\n```\nResponse represents a plugin response object.\n\n","path":"github.com/jenspinney/cli/api/plugin","name":"plugin","synopsis":"","isRedistributable":true}
