utils

package
v0.0.0-...-5a735f6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message string, v ...any)

Logs debug messages.

func Error

func Error(message string, v ...any)

Logs an error and exits the application.

func ExecuteTemplate

func ExecuteTemplate(
	tplData map[string]interface{},
	tpl *template.Template,
) []byte

Executes a template with the provided data.

func Info

func Info(message string, v ...any)

Logs an information.

func LoadYMLFromBytes

func LoadYMLFromBytes(
	content []byte,
	obj interface{},
)

Loads yml data from a byte array.

func LoadYMLFromFile

func LoadYMLFromFile(
	filename string,
	obj interface{},
)

Loads yml data from a file.

func ParseTemplate

func ParseTemplate(
	file string,
) *template.Template

Parses a template defined in a file.

func SetVerbose

func SetVerbose()

Enables verbose output (debug).

func UpdateAndGetMapElementByPath

func UpdateAndGetMapElementByPath(
	structure map[string]interface{},
	keyPath []string,
) map[string]interface{}

Returns the map specified by path If the path does not exist it will be created Returns nil if the element referenced by path is not a map.

func Warn

func Warn(message string, v ...any)

Logs a warning.

Types

This section is empty.

Jump to

Keyboard shortcuts

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