httputil

package module
v0.0.0-...-dff779a Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 5 Imported by: 0

README

httputil

golang http util

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscardBodyAndClose

func DiscardBodyAndClose(resp *http.Response) error

func ReadBodyAndClose

func ReadBodyAndClose(resp *http.Response) ([]byte, error)

Types

type Client

type Client interface {
	Get(url string, header map[string]string) (statusCode int,
		content []byte, err error)
}

Client represents a customized http client

func NewClient

func NewClient(conf ClientConfig) Client

NewClient creates a new client.

type ClientConfig

type ClientConfig struct {
	UseLocalSocks bool
}

ClientConfig defines configurations of client.

type DownloadOption

type DownloadOption func(*DownloadOptions)

type DownloadOptions

type DownloadOptions struct{}

type DownloadRequest

type DownloadRequest struct {
}

type Downloader

type Downloader interface {
	Download(DownloadRequest) error
}

func NewDownloader

func NewDownloader(opts ...DownloadOption) Downloader

Jump to

Keyboard shortcuts

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