Documentation
¶
Overview ¶
Package tags contains code for parsing struct tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
A Handler function handles a tag key/value pair. Returns (true, nil) if the tag is handled successfully.
type StructTag ¶
type StructTag string
A StructTag aliases a struct tag string to add parsing functionality.
func (StructTag) ForEach ¶
ForEach parses tag and iterates over the key/value pairs, passing each to handler. Iteration may be terminated early if handler returns (true, nil). Derived from reflect/type.go Get
type TagOptions ¶
type TagOptions string
TagOptions is the string following a comma in a struct field's "json" tag, or the empty string. It does not include the leading comma. Copy of unexported type tagOptions from encoding/json/tags.go
func ParseTag ¶
func ParseTag(tag string) (string, TagOptions)
ParseTag splits a struct field's json tag into its name and comma-separated options.
func (TagOptions) Contains ¶
func (o TagOptions) Contains(optionName string) bool
Contains reports whether a comma-separated list of options contains a particular substr flag. substr must be surrounded by a string boundary or commas.
Source Files
¶
- tags.go