x: within.website/x/web Index | Files | Directories

package web

import "within.website/x/web"

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

Index

Package Files

error.go

func NewError Uses

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.

type Error Uses

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 Uses

func (e Error) Error() string

func (Error) F Uses

func (e Error) F() ln.F

F ields for logging.

Directories

PathSynopsis
discordwebhookPackage discordwebhook is a simple low-level HTTP client wrapper around Discord webhooks.
switchcounterPackage switchcounter is a simple interface to the https://www.switchcounter.science/ API.
tokipanaPackage tokipana wraps http://inamidst.com/services/tokipana.
tokiponatokensPackage tokiponatokens is a wrapper to a Toki Poka tokenizer.
useragent

Package web imports 5 packages (graph) and is imported by 15 packages. Updated 2019-11-28. Refresh now. Tools for package owners.