http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 8 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) (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

Jump to

Keyboard shortcuts

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