router

package
v0.0.0-...-23cce6b Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpResponseError

func NewHttpResponseError(msg string) error

func NewRouter

func NewRouter(client *at.AirtableClient) *mux.Router

Router for associating HTTP requests with functions based on URI Router takes parameters: Name, Method, Path, and Handler to associate with a function

Types

type Handler

type Handler struct {
	AirtableClient *at.AirtableClient
	H              func(atClient *at.AirtableClient, w http.ResponseWriter, r *http.Request) error
}

Handler object used for allowing handler functions to accept an environment object

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is called on each HTTP request. Specifies which function is called as well as how errors are handled and how logging is set

type HttpResponseError

type HttpResponseError struct {
	// contains filtered or unexported fields
}

func (*HttpResponseError) Error

func (e *HttpResponseError) Error() string

type Routes

type Routes []structs.Route

Jump to

Keyboard shortcuts

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