values

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

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 Filler

type Filler struct {
	// contains filtered or unexported fields
}

func NewFiller

func NewFiller(escapeComma bool, duplicateKeysMode DuplicateKeysMode) *Filler

func (*Filler) Data

func (f *Filler) Data() Tag

func (*Filler) Fill

func (f *Filler) Fill(key, value string) error

type Option

type Option func(*config)

func WithDuplicateKeysMode

func WithDuplicateKeysMode(mode DuplicateKeysMode) Option

func WithEscapeComma

func WithEscapeComma() Option

type Tag

type Tag map[string][]string

Tag is a key/values map.

func Parse

func Parse(tag string, options ...Option) (Tag, error)

Parse parses a struct tag to a `map[string][]string`. The value is split on comma. Ignore duplicated keys by default.

func (Tag) String

func (m Tag) String() string

Jump to

Keyboard shortcuts

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