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.