biu: github.com/tuotoo/biu/param Index | Files

package param

import "github.com/tuotoo/biu/param"

Index

Package Files

parameter.go

Variables

var ErrParamIsEmpty = errors.New("parameter is empty")

ErrParamIsEmpty is error of parameter is empty.

type Parameter Uses

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

Parameter wrap parameter value in a request.

func NewParameter Uses

func NewParameter(val []string, err error) Parameter

func (Parameter) Bool Uses

func (p Parameter) Bool() (bool, error)

Bool converts a parameter value to bool.

func (Parameter) BoolArray Uses

func (p Parameter) BoolArray() ([]bool, error)

BoolArray converts a parameter value to bool array.

func (Parameter) BoolDefault Uses

func (p Parameter) BoolDefault(defaultValue bool) bool

BoolDefault converts a parameter value to bool with default value.

func (Parameter) Bytes Uses

func (p Parameter) Bytes() ([]byte, error)

Bytes converts a parameter value to bytes.

func (Parameter) BytesDefault Uses

func (p Parameter) BytesDefault(defaultValue []byte) []byte

BytesDefault converts a parameter value to bytes with default value.

func (Parameter) Float32 Uses

func (p Parameter) Float32() (float32, error)

Float32 converts a parameter value to float32.

func (Parameter) Float32Array Uses

func (p Parameter) Float32Array() ([]float32, error)

Float32Array converts a parameter value to float32 array.

func (Parameter) Float32Default Uses

func (p Parameter) Float32Default(defaultValue float32) float32

Float32Default converts a parameter value to float32 with default value.

func (Parameter) Float64 Uses

func (p Parameter) Float64() (float64, error)

Float64 converts a parameter value to float64.

func (Parameter) Float64Array Uses

func (p Parameter) Float64Array() ([]float64, error)

Float64Array converts a parameter value to float64 array.

func (Parameter) Float64Default Uses

func (p Parameter) Float64Default(defaultValue float64) float64

Float64Default converts a parameter value to float64 with default value.

func (Parameter) Int Uses

func (p Parameter) Int() (int, error)

Int converts a parameter value to int.

func (Parameter) Int16 Uses

func (p Parameter) Int16() (int16, error)

Int16 converts a parameter value to int16.

func (Parameter) Int16Array Uses

func (p Parameter) Int16Array() ([]int16, error)

Int16Array converts a parameter value to int16 array.

func (Parameter) Int16Default Uses

func (p Parameter) Int16Default(defaultValue int16) int16

Int16Default converts a parameter value to int16 with default value.

func (Parameter) Int32 Uses

func (p Parameter) Int32() (int32, error)

Int32 converts a parameter value to int32.

func (Parameter) Int32Array Uses

func (p Parameter) Int32Array() ([]int32, error)

Int32Array converts a parameter value to int32 array.

func (Parameter) Int32Default Uses

func (p Parameter) Int32Default(defaultValue int32) int32

Int32Default converts a parameter value to int32 with default value.

func (Parameter) Int64 Uses

func (p Parameter) Int64() (int64, error)

Int64 converts a parameter value to int64.

func (Parameter) Int64Array Uses

func (p Parameter) Int64Array() ([]int64, error)

Int64Array converts a parameter value to int64 array.

func (Parameter) Int64Default Uses

func (p Parameter) Int64Default(defaultValue int64) int64

Int64Default converts a parameter value to int64 with default value.

func (Parameter) Int8 Uses

func (p Parameter) Int8() (int8, error)

Int8 converts a parameter value to int8.

func (Parameter) Int8Array Uses

func (p Parameter) Int8Array() ([]int8, error)

Int8Array converts a parameter value to int8 array.

func (Parameter) Int8Default Uses

func (p Parameter) Int8Default(defaultValue int8) int8

Int8Default converts a parameter value to int8 with default value.

func (Parameter) IntArray Uses

func (p Parameter) IntArray() ([]int, error)

IntArray converts a parameter value to int array.

func (Parameter) IntDefault Uses

func (p Parameter) IntDefault(defaultValue int) int

IntDefault converts a parameter value to int with default value.

func (Parameter) String Uses

func (p Parameter) String() (string, error)

String converts a parameter value to string.

func (Parameter) StringArray Uses

func (p Parameter) StringArray() ([]string, error)

StringArray converts a parameter value to string array.

func (Parameter) StringDefault Uses

func (p Parameter) StringDefault(defaultValue string) string

StringDefault converts a parameter value to string with default value.

func (Parameter) Time Uses

func (p Parameter) Time(layout string) (time.Time, error)

Time parse a parameter value to time.Time with given layout.

func (Parameter) TimeArray Uses

func (p Parameter) TimeArray(layout string) ([]time.Time, error)

TimeArray parse a parameter value to time.Time array.

func (Parameter) TimeDefault Uses

func (p Parameter) TimeDefault(layout string, defaultValue time.Time) time.Time

TimeDefault parse a parameter value to time.Time with given layout with default value.

func (Parameter) Uint Uses

func (p Parameter) Uint() (uint, error)

Uint converts a parameter value to uint.

func (Parameter) Uint16 Uses

func (p Parameter) Uint16() (uint16, error)

Uint16 converts a parameter value to uint16.

func (Parameter) Uint16Array Uses

func (p Parameter) Uint16Array() ([]uint16, error)

Uint16Array converts a parameter value to uint16 array.

func (Parameter) Uint16Default Uses

func (p Parameter) Uint16Default(defaultValue uint16) uint16

Uint16Default converts a parameter value to uint16 with default value.

func (Parameter) Uint32 Uses

func (p Parameter) Uint32() (uint32, error)

Uint32 converts a parameter value to uint32.

func (Parameter) Uint32Array Uses

func (p Parameter) Uint32Array() ([]uint32, error)

Uint32Array converts a parameter value to uint32 array.

func (Parameter) Uint32Default Uses

func (p Parameter) Uint32Default(defaultValue uint32) uint32

Uint32Default converts a parameter value to uint32 with default value.

func (Parameter) Uint64 Uses

func (p Parameter) Uint64() (uint64, error)

Uint64 converts a parameter value to uint64.

func (Parameter) Uint64Array Uses

func (p Parameter) Uint64Array() ([]uint64, error)

Uint64Array converts a parameter value to uint64 array.

func (Parameter) Uint64Default Uses

func (p Parameter) Uint64Default(defaultValue uint64) uint64

Uint64Default converts a parameter value to uint64 with default value.

func (Parameter) Uint8 Uses

func (p Parameter) Uint8() (uint8, error)

Uint8 converts a parameter value to uint8.

func (Parameter) Uint8Array Uses

func (p Parameter) Uint8Array() ([]uint8, error)

Uint8Array converts a parameter value to uint8 array.

func (Parameter) Uint8Default Uses

func (p Parameter) Uint8Default(defaultValue uint8) uint8

Uint8Default converts a parameter value to uint8 with default value.

func (Parameter) UintArray Uses

func (p Parameter) UintArray() ([]uint, error)

UintArray converts a parameter value to uint array.

func (Parameter) UintDefault Uses

func (p Parameter) UintDefault(defaultValue uint) uint

UintDefault converts a parameter value to uint with default value.

Package param imports 4 packages (graph) and is imported by 2 packages. Updated 2018-08-25. Refresh now. Tools for package owners.