reflect

package
v0.0.0-...-231aa65 Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assign

func Assign(dst, src interface{}) error

Assign tries to convert source to destination. If possible, it converts the string to the destination type.

func AssignString

func AssignString(dst interface{}, src string) error

AssignString tries to convert the string to the appropriate type and assign it to the destination variable.

func AssignStringToValue

func AssignStringToValue(dst reflect.Value, src string) (err error)

AssignStringToValue tries to convert the string to the appropriate type and assign it to the destination variable.

func AssignValue

func AssignValue(dst, src reflect.Value) (err error)

AssignValue tries to convert source to destination. If possible, it converts the string to the destination type.

func Clear

func Clear(v interface{})

Clear variable

func Traverse

func Traverse(v interface{}, process ProcessValue) error

Traverse iterates through all the nested elements of the passed variable.

func TraverseFields

func TraverseFields(v interface{}, processField ProcessValue) error

TraverseFields iterates through all structs's fields of the passed variable.

func TraverseValue

func TraverseValue(v reflect.Value, process ProcessValue) error

TraverseValue iterates through all the nested elements of the passed variable.

func TraverseValueFields

func TraverseValueFields(v reflect.Value, processField ProcessValue) error

TraverseValueFields iterates through all structs's fields of the passed variable.

Types

type ProcessValue

type ProcessValue func(value reflect.Value, path string, level uint, field *reflect.StructField) error

ProcessValue is type of callback function for Traverse function.

Jump to

Keyboard shortcuts

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