util

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForDecimalMode

func CheckForDecimalMode(mode int, directory bool) error

CheckForDecimalMode fails if the specified mode appears to have been incorrectly specified in decimal instead of octal.

func EnsurePathWithinFilesDir

func EnsurePathWithinFilesDir(path, filesDir string) error

func MakeDataURL

func MakeDataURL(contents []byte, currentCompression *string, allowCompression bool) (uri string, compression *string, err error)

func MergeTranslatedConfigs

func MergeTranslatedConfigs(parent interface{}, parentTranslations translate.TranslationSet, child interface{}, childTranslations translate.TranslationSet) (interface{}, translate.TranslationSet)

MergeTranslatedConfigs merges a parent and child config and returns the result. It also generates and returns the merged TranslationSet by mapping the parent/child TranslationSets through the merge transcript.

func ReadLocalFile added in v0.18.0

func ReadLocalFile(configPath, filesDir string) ([]byte, error)

func VerifyReport added in v0.19.0

func VerifyReport(t *testing.T, obj interface{}, r report.Report)

VerifyReport verifies that every path in a report corresponds to a valid field in the object.

func VerifyTranslations

func VerifyTranslations(t *testing.T, set translate.TranslationSet, exceptions []translate.Translation)

VerifyTranslations validates a TranslationSet from 'yaml' to 'json'. It expects all translations to be identity, unless they match a listed one, and all the listed ones to exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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