params

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

type Mapper func(v string) (key string, value interface{})

Mapper returns the mapped key-value pair.

type Params

type Params struct {
	// contains filtered or unexported fields
}

Params holds the params' internal state.

func NewParams

func NewParams() *Params

NewParams returns a new params.

func (*Params) Convert

func (p *Params) Convert(key string, value string) (string, interface{})

Convert produces a new key-value pairs by corresponding mapper.

func (*Params) IsPermitted

func (p *Params) IsPermitted(param string) bool

IsPermitted checks whether the param is permitted.

func (*Params) Permit

func (p *Params) Permit(params ...string)

Permit a param.

func (*Params) SetMapper

func (p *Params) SetMapper(key string, mapper Mapper)

SetMapper sets a param mapper.

Jump to

Keyboard shortcuts

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