web

package
Version: v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Overview

Package web is a simple collection of high-level error and transport types that I end up using over and over.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(wantStatusCode int, resp *http.Response) error

NewError creates an Error based on an expected HTTP status code vs data populated from an HTTP response.

This consumes the body of the HTTP response.

Types

type Error

type Error struct {
	WantStatus, GotStatus int
	URL                   *url.URL
	Method                string
	ResponseBody          string
}

Error is a web response error. Use this when API calls don't work out like you wanted them to.

func (Error) Error

func (e Error) Error() string

func (Error) F

func (e Error) F() ln.F

F ields for logging.

Source Files

Directories

Path Synopsis
Package discordwebhook is a simple low-level HTTP client wrapper around Discord webhooks.
Package discordwebhook is a simple low-level HTTP client wrapper around Discord webhooks.
Package switchcounter is a simple interface to the https://www.switchcounter.science/ API.
Package switchcounter is a simple interface to the https://www.switchcounter.science/ API.
Package tokipana wraps http://inamidst.com/services/tokipana.
Package tokipana wraps http://inamidst.com/services/tokipana.
Package tokiponatokens is a wrapper to a Toki Poka tokenizer.
Package tokiponatokens is a wrapper to a Toki Poka tokenizer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL