utils

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package utils contains various utility functions to use in other packages

Package utils contains various utility functions to use in other packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(target, list interface{}) bool

Contains if a function to check if list contains target

func ContainsInString

func ContainsInString(target string, list []string) bool

ContainsInString verifies if some string in list contains the specified target

func DecryptAnsibleVault

func DecryptAnsibleVault(fileContent []byte, secret string) []byte

DecryptAnsibleVault verifies if the fileContent is encrypted by ansible-vault. If yes, the function decrypts it

func GetExtension

func GetExtension(path string) (string, error)

GetExtension gets the extension of a file path

func HandlePanic

func HandlePanic(r any, errMessage string)

func LineCounter

func LineCounter(path string) (int, error)

LineCounter get the number of lines of a given file

func MergeMaps

func MergeMaps(map1, map2 map[string]interface{})

MergeMaps merges two maps

func NextRandom

func NextRandom() string

NextRandom returns a random number

func SortedKeys

func SortedKeys(mapToSort map[string]string) []string

SortedKeys returns a sorted slice with all map keys

func SplitLines

func SplitLines(content string) *[]string

SplitLines splits the document by line

func ValidateUUID

func ValidateUUID(id string) bool

ValidateUUID checks if the given id is valid by the format UUID using regex expression

Types

This section is empty.

Jump to

Keyboard shortcuts

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