chiuriattr

package module
v0.0.0-...-ea13cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 6 Imported by: 0

README

Chi Query Attr

Build Status codecov Documentation

Query attr makes it easy to access the query attributes stored in a Chi route.

Installation

go get -u github.com/tomwright/chiuriattr

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Delimiter specifies the string that will be used to split uri parameters when the target is a slice
	Delimiter = ","

	// ErrNonPointerTarget is returned when the given interface does not represent a pointer
	ErrNonPointerTarget = errors.New("invalid Unmarshal target. must be a pointer")
	// ErrInvalidRequest is returned when the given *url.URL is nil
	ErrInvalidRequest = errors.New("invalid request provided")
	// ErrInvalidDelimiter is returned when trying to split a uri param into a slice with an invalid separator
	ErrInvalidDelimiter = errors.New("invalid uri attr separator")
	// ErrNilSliceField is returned when Unmarshal is given a slice target that has not been initialised
	ErrNilSliceField = errors.New("field target of slice cannot be nil")
)

Functions

func Unmarshal

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

Unmarshal attempts to parse uri attributes from the specified URL and store any found values into the given interface

Types

This section is empty.

Jump to

Keyboard shortcuts

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