Documentation

Overview

Package utils contains a bunch of small functions used by task/ subpackages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateKVList

func ValidateKVList(kind string, list []string, sep rune) error

ValidateKVList makes sure each string in the list is valid key-value pair.

Types

type KV

type KV struct {
	Key   string
	Value string
}

KV is key and value strings.

type KVList

type KVList []KV

KVList if list of KV pairs.

func KVListFromMap

func KVListFromMap(m map[string]string) KVList

KVListFromMap converts a map to KVList.

func UnpackKVList

func UnpackKVList(list []string, sep rune) (out KVList)

UnpackKVList takes validated list of k-v pair strings and returns list of structs.

Silently skips malformed strings. Use ValidateKVList to detect them before calling this function.

func (KVList) Pack

func (l KVList) Pack(sep rune) []string

Pack converts KV list to a list of strings.

Source Files

Directories

Path Synopsis