keyvalue

package
v0.0.0-...-f0b4a20 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToUpper

func KeyToUpper(kv *Pair) error

KeyToUpper transforms the key to uppercase

func RemoveOuterQuotes

func RemoveOuterQuotes(kv *Pair) error

RemoveOuterQuotes removes outer quotes on a value

Types

type Pair

type Pair struct {
	Key   string
	Value string
}

Pair represents a simple pair of a key and value

func ParsePair

func ParsePair(value string, transform ...TransformPair) (*Pair, error)

ParsePair parses a Pair delimited as "key=value"

func (*Pair) String

func (kv *Pair) String() string

type PairMap

type PairMap map[string]string

PairMap represents a PairSlice transformed as a map[string]string

type PairSlice

type PairSlice []*Pair

PairSlice represents a slice of KeyValuePair

func ParsePairSlice

func ParsePairSlice(in string, transform ...TransformPair) (PairSlice, error)

ParsePairSlice parses a list of newline delimited key value pairs

func (PairSlice) String

func (s PairSlice) String() string

func (PairSlice) ToMap

func (s PairSlice) ToMap() (PairMap, error)

ToMap converts a PairSlice to a KeyValuePairMap returning an error if there are duplicate keys

type TransformPair

type TransformPair func(kv *Pair) error

TransformPair applies a transformation to a KeyValuePair

Jump to

Keyboard shortcuts

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