utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Package utils contains various utility functions to use in other packages

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustNumWorkers

func AdjustNumWorkers(workers int) int

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(ctx context.Context, 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(ctx context.Context, path string) (string, error)

GetExtension gets the extension of a file path

func HandlePanic

func HandlePanic(ctx context.Context, r any, errMessage string)

func LineCounter

func LineCounter(ctx context.Context, 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 SplitLines

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