param

package
v0.0.0-...-75eda33 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bool = BoolVar(nil)
View Source
var String = StringVar(nil)
View Source
var Uint64 = Uint64Var(nil)

Functions

This section is empty.

Types

type Param

type Param interface {
	Name() string
	From(arg []byte) (value interface{}, err error)
}

func New

func New(name string, p Parser) Param

func Specialize

func Specialize(p Param, name string, next Transformer) Param

func Untyped

func Untyped(tt ...TypedParam) []Param

type Parser

type Parser func(arg []byte) (value interface{}, err error)

type Transformer

type Transformer func(in interface{}) (out interface{}, err error)

type TypedParam

type TypedParam interface {
	Param
	Type() reflect.Type
}

func BoolVar

func BoolVar(ref *bool) TypedParam

func SpecializeTyped

func SpecializeTyped(p TypedParam, name string, next Transformer) TypedParam

func StringVar

func StringVar(ref *string) TypedParam

func Typed

func Typed(name string, t reflect.Type, p Parser) TypedParam

func Uint64Var

func Uint64Var(ref *uint64) TypedParam

Jump to

Keyboard shortcuts

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