bind

package
v0.0.0-...-54feab4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

package bind provides reflection shortcuts for binding key/value pairs and strings to static types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Params

func Params(v interface{}, params httprouter.Params) error

Params parses httprouter.Params and injects them into v.

func ParamsValue

func ParamsValue(obj reflect.Value, params httprouter.Params) error

ParamsValue parses httprouter.Params and injects them into v.

func Query

func Query(v interface{}, q url.Values) error

Query parses query parameters from the http.Request and injects them into v

func QueryValue

func QueryValue(obj reflect.Value, q url.Values) error

QueryValue parses query parameters from the http.Request and injects them into v

Types

type TypeMismatchError

type TypeMismatchError struct {
	Kind      reflect.Kind
	Val       interface{}
	Cause     error
	FieldName string
}

TypeMismatchError is an error that is caused by attempting to bind a type to a field with a different type.

func (TypeMismatchError) Error

func (e TypeMismatchError) Error() string

Jump to

Keyboard shortcuts

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