Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuplicateKeysMode ¶
type DuplicateKeysMode int
const ( // DuplicateKeysIgnore skips silently duplicate keys. DuplicateKeysIgnore DuplicateKeysMode = iota // DuplicateKeysDeny throws an error when duplicate keys are found. DuplicateKeysDeny // DuplicateKeysAllow NOT RECOMMENDED: this does not follow the struct tag conventions. DuplicateKeysAllow )
type Entry ¶
Entry represents a struct tag entry. An entry is composed of a key and a value.
type Filler ¶
type Filler struct {
// contains filtered or unexported fields
}
Filler fills the tag from a struct tag.
func NewFiller ¶
func NewFiller(escapeComma bool, duplicateKeysMode DuplicateKeysMode) *Filler
NewFiller creates a new Filler.
type Option ¶
type Option func(*config)
func WithDuplicateKeysMode ¶
func WithDuplicateKeysMode(mode DuplicateKeysMode) Option
func WithEscapeComma ¶
func WithEscapeComma() Option
type Tag ¶
type Tag struct {
// contains filtered or unexported fields
}
Tag represents a struct tag.
func NewTag ¶
func NewTag(escapeComma bool, duplicateKeysMode DuplicateKeysMode) *Tag
NewTag creates a new Tag.
func Parse ¶
Parse parses a struct tag to a Tag. Allows modifying the struct tags. The value is split on comma. Ignore duplicated keys by default.
Click to show internal directories.
Click to hide internal directories.