utils

package
v1.6.13-integrations Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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 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

Types

This section is empty.

Jump to

Keyboard shortcuts

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