rester

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryParam

type QueryParam struct {
	Key, Value string
	Encode     bool
}

type RESTer

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

func New

func New() *RESTer

func (RESTer) Do

func (r RESTer) Do(retries int, timeout string) (interface{}, Response)

func (RESTer) DoWithHelperFunc

func (r RESTer) DoWithHelperFunc(retries int, timeout string, f func(res Response, err error)) interface{}

func (RESTer) Get

func (r RESTer) Get(urlString string, headers map[string]string, params []QueryParam) *RESTer

Get a URL, returns a json string. DOES NOT UNMARSHAL

func (RESTer) GetBytes

func (r RESTer) GetBytes(urlString string, headers map[string]string, params []QueryParam) *RESTer

GetBytes from a URL, returns raw bytes. DOES NOT UNMARSHAL

type Response

type Response struct {
	Body       []byte
	StatusCode int
	Headers    map[string][]string
}

Jump to

Keyboard shortcuts

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