Categorygithub.com/pghq/go-tea
modulepackage
0.3.0
Repository: https://github.com/pghq/go-tea.git
Documentation: pkg.go.dev

# README

go-tea

Golang entrypoint for REST web apps and client libraries (internal only).

Installation

go-tea may be installed using the go get command:

go get github.com/pghq/go-tea

Usage

To create a new router:

import "github.com/pghq/go-tea"

r := tea.NewRouter("")
r.Route("GET", "/test", func(w http.ResponseWriter, r *http.Request){})

# Packages

No description provided by the author
No description provided by the author

# Functions

Go handle a http request.
MethodNotAllowedHandler is a custom handler for method not allowed requests.
NewCORSMiddleware constructs a new middleware that handles CORS.
NewProxy creates a new multi-host reverse proxy.
NewRouter constructs a new mux based Router.
NotFoundHandler is a custom handler for not found requests.
Parse is a method to decode a http request into a value schema struct tags are supported.
ParseHeaders decode http request headers.
ParsePath decode http path.
ParseQuery decode http query.
Send sends an HTTP response based on content type and body.
WithServicePrefix creates a service prefix option.

# Structs

CORSMiddleware is an implementation of the CORS middleware providing method, origin, and credential allowance.
Proxy is a multi-host reverse proxy.
Router is an instance of a mux based Router.

# Interfaces

Middleware represents a handler that is called to for example, modify request/response before or after the principal handler is called.
RouteHandler a handler for routing http requests.

# Type aliases

MiddlewareFunc handles http middleware requests.
RouterOption is a handler for configuring the router.