http

package
v0.0.0-...-0a82276 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: AGPL-3.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenURI

func OpenURI(ctx context.Context, httpClient HTTPDoer, uri string, query url.Values) (io.ReadCloser, error)

OpenURI performs a GET on a Juju HTTP endpoint returning the specified blob.

Types

type HTTPClient

type HTTPClient interface {
	// Do sends the HTTP request, returning the subsequent response.
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an API-specific HTTP client.

type HTTPDoer

type HTTPDoer interface {
	// Do sends the given request.
	Do(context context.Context, req *http.Request, resp interface{}) error
}

HTTPDoer exposes the functionality of httprequest.Client needed here.

type URIOpener

type URIOpener interface {
	OpenURI(ctx context.Context, uri string, query url.Values) (io.ReadCloser, error)
}

URIOpener provides the OpenURI method.

func NewURIOpener

func NewURIOpener(apiConn base.APICaller) (URIOpener, error)

NewURIOpener returns a URI opener for the api caller.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL