muxtagconfig

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: MIT Imports: 6 Imported by: 0

README

muxtagconfig

A TagValueGetter implementation for populating a struct based off of vars parsed by https://github.com/gorilla/mux

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMuxRequestToStruct

func ParseMuxRequestToStruct(req *http.Request, container interface{}) error

ParseMuxRequestToStruct is a convenience method so to wrap the operations of creating a MuxURLGetter and running tagconfig.Process

Types

type MuxURLGetter

type MuxURLGetter struct {
	*http.Request
}

MuxURLGetter Implements the TagValueGetter to parse struct tagconfig into a struct instance

func (*MuxURLGetter) Get

func (mg *MuxURLGetter) Get(key string, f reflect.StructField) (v string)

Get will be called from tagconfig.Process for any fields with the tag mux.url and consult secondary fields mux.param, mux.form and mux.path to retrieve the appropriate value for the struct field

func (*MuxURLGetter) TagName

func (mg *MuxURLGetter) TagName() string

Jump to

Keyboard shortcuts

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