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 user_agent.go

func GenUserAgent Uses

func GenUserAgent() string

GenUserAgent creates a unique User-Agent string for outgoing HTTP requests.

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.

Package web imports 9 packages (graph) and is imported by 18 packages. Updated 2019-07-02. Refresh now. Tools for package owners.