http

package
v0.0.0-...-2eeffc0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

Simple HTTP worker for gobench

Supports only GET method.

get

get("http://myserver.com/mypage?myparam=1")

Full example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewHttpClient

func NewHttpClient(ctx context.Context, prefix string, config ...HttpClientConfig) (HttpClient, error)

func (*HttpClient) Get

func (h *HttpClient) Get(ctx context.Context, url string, headers map[string]string) ([]byte, error)

Get makes http get request and record the metrics

func (*HttpClient) Post

func (h *HttpClient) Post(ctx context.Context, url string, body []byte, headers map[string]string) ([]byte, error)

Post makes http post request and record the metrics

type HttpClientConfig

type HttpClientConfig struct {
	DnsResolveOverride string
	VerifyTLS          bool
}

Jump to

Keyboard shortcuts

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