utility

package
v0.0.0-...-3119dd1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret(secretVersion string) (secret string, err error)

GetSecret retrieves the named Cloud Secret version. It returns the contents of the secret as a string.

func IsRepoURL

func IsRepoURL(url string) bool

Checks if a URL is to a supported repo.

func SliceEqual

func SliceEqual[K comparable](a []K, b []K) bool

SliceEqual returns true if two slices have identical items in the same order

func SliceEqualUnordered

func SliceEqualUnordered[K comparable](a []K, b []K) bool

SliceEqualUnordered returns true if two slices have identical items, in any order

Types

type LoggerWrapper

type LoggerWrapper struct {
	GCloudLogger *logging.Logger
}

LoggerWrapper wraps the Logger provided by google cloud Will default to the go stdout and stderr logging if GCP logger is not set

func CreateLoggerWrapper

func CreateLoggerWrapper(logID string) (LoggerWrapper, func())

CreateLoggerWrapper creates and initializes the LoggerWrapper, and also returns a cleanup function to be deferred

func (LoggerWrapper) Fatalf

func (wrapper LoggerWrapper) Fatalf(format string, a ...any)

Fatalf prints Error level log with stack trace, before exiting with error code 1

func (LoggerWrapper) Infof

func (wrapper LoggerWrapper) Infof(format string, a ...any)

Infof prints Info level log

func (LoggerWrapper) Warnf

func (wrapper LoggerWrapper) Warnf(format string, a ...any)

Warnf prints Warning level log, defaults to stdout if GCP logger is not set

Jump to

Keyboard shortcuts

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