streaming

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 2 Imported by: 49

Documentation

Overview

Package streaming contains helpers for streaming IO operations and progress reporting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequestProgress

func NewRequestProgress(body io.ReadSeekCloser, pr func(bytesTransferred int64)) io.ReadSeekCloser

NewRequestProgress adds progress reporting to an HTTP request's body stream.

func NewResponseProgress

func NewResponseProgress(body io.ReadCloser, pr func(bytesTransferred int64)) io.ReadCloser

NewResponseProgress adds progress reporting to an HTTP response's body stream.

func NopCloser

func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser

NopCloser returns a ReadSeekCloser with a no-op close method wrapping the provided io.ReadSeeker. In addition to adding a Close method to an io.ReadSeeker, this can also be used to wrap an io.ReadSeekCloser with a no-op Close method to allow explicit control of when the io.ReedSeekCloser has its underlying stream closed.

Types

type MultipartContent added in v1.11.0

type MultipartContent struct {
	// Body contains the required content body.
	Body io.ReadSeekCloser

	// ContentType optionally specifies the HTTP Content-Type for this Body.
	// The default value is application/octet-stream.
	ContentType string

	// Filename optionally specifies the filename for this Body.
	// The default value is the field name for the multipart/form section.
	Filename string
}

MultipartContent contains streaming content used in multipart/form payloads.

Jump to

Keyboard shortcuts

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