luci: Index | Files | Directories

package utils

import ""

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


Package Files

apiclient.go doc.go kvlist.go

func IsTransientAPIError Uses

func IsTransientAPIError(err error) bool

IsTransientAPIError returns true if error from Google API client indicates an error that can go away on its own in the future.

func ValidateKVList Uses

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

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

func WrapAPIError Uses

func WrapAPIError(err error) error

WrapAPIError wraps error from Google API client in transient wrapper if necessary.

type KV Uses

type KV struct {
    Key   string
    Value string

KV is key and value strings.

type KVList Uses

type KVList []KV

KVList if list of KV pairs.

func KVListFromMap Uses

func KVListFromMap(m map[string]string) KVList

KVListFromMap converts a map to KVList.

func UnpackKVList Uses

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 Uses

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

Pack converts KV list to a list of strings.



Package utils imports 5 packages (graph) and is imported by 4 packages. Updated 2021-01-24. Refresh now. Tools for package owners.