base

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const NotifyBaseURL = "https://rest-api.notify.gov.au"

Variables

This section is empty.

Functions

func PathParams

func PathParams(parameters ...string) requestOptionFunc

Types

type Client

type Client struct {
	http.Client

	BaseURL     *url.URL
	ServiceID   string
	APIKey      string
	RouteSecret string
}

func (Client) Do

func (c Client) Do(req *http.Request) (*http.Response, error)

func (Client) Get

func (c Client) Get(path string, options ...requestOption) Response

func (Client) Post

func (c Client) Post(path string, body io.Reader, options ...requestOption) Response

type QueryValues

type QueryValues []struct{ Key, Value string }

type Response

type Response struct {
	Error error
	// contains filtered or unexported fields
}

func BadResponse

func BadResponse(err error) Response

func (Response) JSON

func (resp Response) JSON(v interface{}, at ...string) Response

func (Response) JSONData

func (resp Response) JSONData(v interface{}) Response

Jump to

Keyboard shortcuts

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