api

package
v3.6.5-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HttpBodySizeLimit = 1048576

Variables

This section is empty.

Functions

func AppendRequest

func AppendRequest(err error, req *http.Request) error

AppendRequest appends HTTP request information to an error string.

func DecodeBody

func DecodeBody(i interface{}, r *http.Request) error

DecodeBody unmarshals the JSON object in the HTTP request body to an object.

func ReadBody

func ReadBody(r *http.Request) ([]byte, error)

ReadBody returns the HTTP request body.

func WriteBody

func WriteBody(r *http.Request, body []byte)

WriteBody creates a new HTTP request body in an existing HTTP request.

Types

type Route

type Route struct {
	Name        string
	Path        string
	Method      string
	Protected   bool
	HandlerFunc http.HandlerFunc
}

Route is a HTTP verb/path-to-handler-function mapping.

type Routes

type Routes []Route

Routes is a collection of HTTP verb/path-to-handler-function mappings.

Directories

Path Synopsis
v1
v2
v3

Jump to

Keyboard shortcuts

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