http

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchDefaultEncoded added in v0.0.4

func FetchDefaultEncoded[TModel any](method string, url string, res *TModel) error

func WithHeader

func WithHeader(key string, value string) func(req *http.Request)

Types

type FetchFunc

type FetchFunc[TModel any] func(data *TModel) error

func Fetcher

func Fetcher[TModel any](method string, url string) FetchFunc[TModel]

func FetcherWithClient

func FetcherWithClient[TModel any](c *http.Client, method string, url string, headers ...HeaderOption) FetchFunc[TModel]

type FetcherReader

type FetcherReader func(ctx context.Context, f func(ctx context.Context, reader io.Reader) error) error

func FetcherCustom

func FetcherCustom(c *http.Client, method string, url string, headers ...HeaderOption) FetcherReader

type HeaderOption

type HeaderOption func(req *http.Request)

func WithCompression

func WithCompression() HeaderOption

type IterateFetch

type IterateFetch[TModel any] func(f func(data TModel) error) error

func Iterator

func Iterator[TModel any](method string, url string, level int, headers ...HeaderOption) IterateFetch[TModel]

func IteratorWithClient

func IteratorWithClient[TModel any](c *http.Client, method string, url string, level int, headers ...HeaderOption) IterateFetch[TModel]

Jump to

Keyboard shortcuts

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