httpotel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallApi

func CallApi(ctx context.Context, url string, method string, reqBody io.Reader, timeOut time.Duration, options ...ClientOptionFunc) ([]byte, error)

Types

type ClientOption

type ClientOption struct {
	Transport   *http.Transport
	Headers     map[string]string
	ContentType string
}

func (*ClientOption) WithContentType

func (o *ClientOption) WithContentType(contentType string) ClientOptionFunc

WithContentType set content type

func (*ClientOption) WithHeaders

func (o *ClientOption) WithHeaders(headers map[string]string) ClientOptionFunc

WithHeaders set headers

func (*ClientOption) WithTransport

func (o *ClientOption) WithTransport(transport *http.Transport) ClientOptionFunc

WithTransport set transport

type ClientOptionFunc

type ClientOptionFunc func(option *ClientOption)

Jump to

Keyboard shortcuts

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