utils

package
v1.7.13 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 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 added in v1.5.5

func Contains(target, list interface{}) bool

Contains if a function to check if list contains target

func ContainsInString added in v1.6.1

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

ContainsInString verifies if some string in list contains the specified target

func DecryptAnsibleVault added in v1.5.4

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 added in v1.5.10

func GetExtension(path string) string

GetExtension gets the extension of a file path

func HandlePanic added in v1.7.7

func HandlePanic(r any, errMessage string)

func LineCounter added in v1.6.13

func LineCounter(path string) (int, error)

LineCounter get the number of lines of a given file

func MergeMaps added in v1.5.0

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

MergeMaps merges two maps

func NextRandom added in v1.5.0

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 added in v1.5.15

func SplitLines(content string) *[]string

SplitLines splits the document by line

func ValidateUUID added in v1.7.1

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