utils

package
v4.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindChannels

func BindChannels[T any](source <-chan T, dest chan<- T, wg *sync.WaitGroup)

func BindFlags

func BindFlags(cmd *cobra.Command, v *viper.Viper, envPrefix string) error

BindFlags fill flags values with config file or environment variables data

func CreateBasicAuthCredentials

func CreateBasicAuthCredentials(credentials ICredentials) string

func CreateLogger

func CreateLogger(minimumLevel zerolog.Level) zerolog.Logger

func HttpRequest

func HttpRequest(method, url string, authorization IAuthorizationHeader, retry RetrySettings) ([]byte, *http.Response, error)

func LoadConfig

func LoadConfig(v *viper.Viper, configFilePath string) error

func NormalizeReportData

func NormalizeReportData(data interface{}) (interface{}, error)

normalizeReportData recursively traverses the report data and removes any carriage return characters.

Types

type IAuthorizationHeader

type IAuthorizationHeader interface {
	GetAuthorizationHeader() string
}

type ICredentials

type ICredentials interface {
	GetCredentials() (string, string)
}

type RetrySettings

type RetrySettings struct {
	MaxRetries int
	ErrorCodes []int
}

type SpecificLevelWriter

type SpecificLevelWriter struct {
	io.Writer
	Levels []zerolog.Level
}

func (SpecificLevelWriter) WriteLevel

func (w SpecificLevelWriter) WriteLevel(level zerolog.Level, p []byte) (int, error)

Jump to

Keyboard shortcuts

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