http

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpTimeout time.Duration = time.Second * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client[T any, R any] struct {
	*Options[T, R]
	// contains filtered or unexported fields
}

func NewClient

func NewClient[T any, R any](options *Options[T, R]) *Client[T, R]

func (*Client[T, R]) Go

func (p *Client[T, R]) Go() error

func (*Client[T, R]) Validate

func (p *Client[T, R]) Validate() error

type Options

type Options[T any, R any] struct {
	Method   string
	URL      string
	Header   http.Header
	Prepare  func(*Options[T, R], *http.Request, []byte) error
	Timeout  time.Duration
	Request  T
	Response R
	Encode   bool
	Decode   bool

	LogPrefix string
	LogDebug  bool
}

Jump to

Keyboard shortcuts

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