helpers

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceContains

func InterfaceContains(s []interface{}, e string) bool

func PrettyJson

func PrettyJson(in string) string

func PrettyMarshal

func PrettyMarshal(data interface{}) (string, error)

func ReplaceVars

func ReplaceVars(text string, vars interface{}, funcs template.FuncMap) (string, error)

func StringContains

func StringContains(s []string, e string) bool

func StructToMap

func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)

Converts a struct to a map while maintaining the json alias as keys

func UnmarshalByExt

func UnmarshalByExt(file string, configData []byte) (map[string]interface{}, error)

func UnmarshalFile

func UnmarshalFile(fileName string, fs filesystem.FileSystemInterface) (map[string]interface{}, error)

func UnmarshalJson

func UnmarshalJson(configData []byte) (map[string]interface{}, error)

UnmarshalJson parses JSON configuration data into BuilderData.

Parameters:

  • configData: A byte slice containing JSON-formatted configuration data.

Returns:

A pointer to BuilderData and an error if unmarshaling fails.

func UnmarshalYaml

func UnmarshalYaml(configData []byte) (map[string]interface{}, error)

UnmarshalYaml parses YAML configuration data into BuilderData.

Parameters:

  • configData: A byte slice containing YAML-formatted configuration data.

Returns:

A pointer to BuilderData and an error if unmarshaling fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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