http

package
v0.0.0-...-724f8e7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Download

type Download struct {
	// contains filtered or unexported fields
}

A Download downloads data from an endpoint.

func NewDownload

func NewDownload(ctx context.Context, client *http.Client, req *http.Request) *Download

NewDownload creates a new download using the given http client and request.

func (*Download) Close

func (download *Download) Close() error

Close closes the download.

func (*Download) Read

func (download *Download) Read(p []byte) (int, error)

Read reads bytes from the HTTP response.

type Upload

type Upload struct {
	// contains filtered or unexported fields
}

An Upload uploads data to an HTTP endpoint.

func NewUpload

func NewUpload(ctx context.Context, client *http.Client, req *http.Request) *Upload

NewUpload creates a new upload using the given http client and request.

The request body will be overwritten with a pipe reader used by `Write`. `Close` will complete the upload.

func (*Upload) Close

func (upload *Upload) Close() error

func (*Upload) Write

func (upload *Upload) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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