utils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BLANK string = ""
View Source
const BODY_FORMAT_FLAT = `text`
View Source
const BODY_FORMAT_JSON = `json`
View Source
const BODY_FORMAT_YAML = `yaml`
View Source
const DEFAULT_PATH string = `/-`
View Source
const DEFAULT_PDP string = `http://localhost:17779`
View Source
const TAG_CHAR_PATTERN string = `[^a-zA-Z0-9_-]`
View Source
const TAG_PATTERN string = `[a-zA-Z][a-zA-Z0-9]*([_-][a-zA-Z0-9]*)*`
View Source
const TEST_CASE_TITLE_PATTERN string = `.+`
View Source
const TEST_CASE_TITLE_PATTERN_STRICT string = `[a-zA-Z][\\w\\-\\s.:;,]*`
View Source
const TIMEOUT_PATTERN string = `([0-9]+h)?([0-9]+m)?([0-9]+s)?([0-9]+ms)?([0-9]+[uµ]s)?([0-9]+ns)?`
View Source
const TIME_RFC3339 string = `` /* 161-byte string literal not displayed */
View Source
const VERSION_PATTERN string = `[v]?((\\d+\\.)?(\\d+\\.)?(\\*|\\d+))`

Variables

View Source
var TEST_CASE_TITLE_REGEXP *regexp.Regexp = regexp.MustCompile(`^` + strings.ReplaceAll(TEST_CASE_TITLE_PATTERN, `\\`, `\`) + `$`)

Functions

func AppendBlockWithIndent added in v1.0.8

func AppendBlockWithIndent(array []string, block string, indent int) []string

func AppendLinesWithIndent added in v1.0.8

func AppendLinesWithIndent(store []string, lines []string, indent int) []string

func BuildMultilineError added in v1.0.8

func BuildMultilineError(errs []string) error

func CombineErrors added in v1.0.3

func CombineErrors(label string, messages []string) error

func Contains added in v1.0.1

func Contains(vs []string, t string) bool

func ContainsInsensitiveCase added in v1.0.4

func ContainsInsensitiveCase(vs []string, t string) bool

func ContainsInt added in v1.0.4

func ContainsInt(vs []int, t int) bool

func ConvertTabToSpaces added in v1.0.8

func ConvertTabToSpaces(block string, newIndent int) string

func DetectRelativePath added in v1.0.4

func DetectRelativePath(p string) (string, error)

func DetectRelativePaths added in v1.0.6

func DetectRelativePaths(p []string) []string

func Filter added in v1.0.1

func Filter(vs []string, f func(string, int) bool) []string

func FindUsername added in v1.0.4

func FindUsername() (string, error)

func FindWorkingDir

func FindWorkingDir() string

func Flatten added in v1.0.6

func Flatten(docName string, tree map[string]interface{}) (map[string]interface{}, error)

func Index added in v1.0.4

func Index(vs []string, t string) int

func IndexInt added in v1.0.1

func IndexInt(vs []int, t int) int

func IsDir

func IsDir(name string) bool

func LabelifyError added in v1.0.8

func LabelifyError(label string, err error) error

func Map added in v1.0.1

func Map(vs []string, f func(string, int) string) []string

func RefOfInt added in v1.0.4

func RefOfInt(val int) *int

func RefOfString added in v1.0.3

func RefOfString(val string) *string

func Split added in v1.0.1

func Split(str string, sep string) []string

func StandardizeTagLabel added in v1.0.7

func StandardizeTagLabel(tag string) (string, error)

func StandardizeVersion added in v1.0.3

func StandardizeVersion(version string) string

func Unmarshal added in v1.0.8

func Unmarshal(format string, source []byte, target interface{}) error

func UrlJoin

func UrlJoin(pdp string, basePath string) (string, error)

Types

type DevNull added in v1.0.8

type DevNull int

func (DevNull) Write added in v1.0.8

func (DevNull) Write(p []byte) (int, error)

func (DevNull) WriteString added in v1.0.8

func (DevNull) WriteString(s string) (int, error)

Jump to

Keyboard shortcuts

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