web

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ADelete added in v1.1.0

func ADelete(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

authenticated DELETE helper using TOKEN env variable

func AGet

func AGet(url string, timeout time.Duration, headers ...KV) (int, []byte, error)

authenticated GET helper using TOKEN env variable

func APatch added in v1.1.0

func APatch(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

authenticated PATCH helper using TOKEN env variable

func APost

func APost(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

authenticated POST helper using TOKEN env variable

func Delete added in v1.1.0

func Delete(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

http DELETE helper

func Get

func Get(url string, timeout time.Duration, headers ...KV) (int, []byte, error)

http GET helper

func Patch added in v1.1.0

func Patch(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

http PATCH helper

func Post

func Post(url string, timeout time.Duration, b []byte, headers ...KV) (int, []byte, error)

http POST helper

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
	SetTimeout(timeout time.Duration)
}
var Client HTTPClient

type KV

type KV struct {
	Key   string
	Value string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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