structtag

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAPointer = errors.New("Not a pointer")

ErrNotAPointer error when not a pointer

View Source
var ErrNotAStruct = errors.New("Not a struct")

ErrNotAStruct error when not a struct

View Source
var ErrTypeNotSupported = errors.New("Type not supported")

ErrTypeNotSupported error when type not supported

View Source
var ErrUndefinedTag = errors.New("Undefined tag")

ErrUndefinedTag error when Tag var is not defined

View Source
var ParseMap map[reflect.Kind]ReflectFunc

ParseMap points to each of the supported types

View Source
var Prefix string

Prefix is a string that would be placed at the beginning of the generated tags.

Tag set the main tag

View Source
var TagDefault string

TagDefault set tag default

View Source
var TagDisabled string

TagDisabled used to not process an input

View Source
var TagSeparator string

TagSeparator separe names on environment variables

Functions

func Parse

func Parse(s interface{}, superTag string) (err error)

Parse tags on struct instance

func ReflectStruct

func ReflectStruct(field *reflect.StructField, value *reflect.Value, tag string) (err error)

ReflectStruct is called when the Parse encounters a sub-structure in the current structure and then calls Parsr again to treat the fields of the sub-structure.

func Reset

func Reset()

Reset maps caling setup function

func Setup

func Setup()

Setup maps and variables

Types

type ReflectFunc

type ReflectFunc func(
	field *reflect.StructField,
	value *reflect.Value,
	tag string) (err error)

ReflectFunc type used to create funcrions to parse struct and tags

Jump to

Keyboard shortcuts

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