reflect2

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNonPrimitive = errors.Err("not primitive type")
)

Variables

This section is empty.

Functions

func CanNil

func CanNil(v reflect.Value) bool

func IndirectType

func IndirectType(v interface{}) reflect.Type

IndirectType return real type of value without pointer

func IsNil

func IsNil(v interface{}) bool

func IsSlice

func IsSlice(s interface{}) bool

IsSlice check whether or not param is slice

func MarshalPrimitive

func MarshalPrimitive(v reflect.Value) string

func MarshalStruct

func MarshalStruct(v interface{}, values map[string]string, tag string)

func UnmarshalPrimitive

func UnmarshalPrimitive(str string, v reflect.Value) error

UnmarshalPrimitive unmarshal bytes to primitive

func UnmarshalStruct

func UnmarshalStruct(v interface{}, values Values, tag string)

Types

type Equaler

type Equaler interface {
	EqualTo(interface{}) bool
}

Equaler is a interface that compare whether two object is equal

type StringMap

type StringMap map[string]string

func (StringMap) Get

func (m StringMap) Get(name string) string

type StringSliceMap

type StringSliceMap struct {
	Values    map[string][]string
	Seperator string
}

func (StringSliceMap) Get

func (s StringSliceMap) Get(name string) string

type Values

type Values interface {
	Get(name string) string
}

Jump to

Keyboard shortcuts

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