filter

package
v0.0.0-...-d1a64ea Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoContent shows that the underlying HTTP request doesn't contain any data/content
	ErrNoContent = errors.New("No content has been received")

	// ErrInvalidFormFormat shows that the underlying HTTP request has its data or form in a incorrect or unparsable format
	ErrInvalidFormFormat = errors.New("The request form has an invalid format")
)

Functions

func CheckNotNull

func CheckNotNull(data []byte) bool

CheckNotNull verifies if the given []byte data is nil or represents the word "null". In the above stated cases, the method returns false

func GetIDParameter

func GetIDParameter(paramName string, reqForm url.Values) (bson.ObjectId, bool, error)

GetIDParameter extracts a bson.ObjectID value from url paramters, based on its name

func GetIntParameter

func GetIntParameter(paramName string, reqForm url.Values) (int, bool, error)

GetIntParameter extracts an integer value from url paramters, based on its name

func GetStringParameter

func GetStringParameter(paramName string, reqForm url.Values) (string, bool)

GetStringParameter extracts a string value from url paramters, based on its name

func ParseRequestContent

func ParseRequestContent(request *http.Request) (int, error)

CheckMethodAndParseContent performs validity checks on a request based on the HTTP method used. Checks are made for data content if the methods are POST or PUT, and if the url form can be correctly parsed

Types

This section is empty.

Jump to

Keyboard shortcuts

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