utils

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 2 Imported by: 8

README

go-utils

Simple utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvWithDefault

func GetEnvWithDefault(key, defaultValue string) string

GetEnvWithDefault returns the value of the environment variable named by the key. It is guaranteed to return the default value if the environment variable is not found or is empty.

func GetEnvWithDefaultNP

func GetEnvWithDefaultNP(key, defaultValue string, nonEmpty bool) string

GetEnvWithDefaultNP returns the value of the environment variable named by the key. It is guaranteed to return the default value if the environment variable is not found. If the environment variable is found, it is guaranteed to return the default value if the environment variable is empty.

func PanicIfError added in v0.0.2

func PanicIfError(err error)

PanicIfError panics if the error is not nil.

Types

type SimpleTaggedLog added in v0.0.2

type SimpleTaggedLog struct {
	Debug bool
	// contains filtered or unexported fields
}

func NewDebugLogger added in v0.0.2

func NewDebugLogger() SimpleTaggedLog

func NewLogger added in v0.0.2

func NewLogger() SimpleTaggedLog

func WrapLogger added in v0.0.2

func WrapLogger(logger *lg.Logger, debug bool) SimpleTaggedLog

func (SimpleTaggedLog) Debugf added in v0.0.2

func (l SimpleTaggedLog) Debugf(format string, args ...interface{})

func (SimpleTaggedLog) Errorf added in v0.0.2

func (l SimpleTaggedLog) Errorf(format string, args ...interface{})

func (SimpleTaggedLog) Infof added in v0.0.2

func (l SimpleTaggedLog) Infof(format string, args ...interface{})

func (SimpleTaggedLog) PanicIfError added in v0.0.2

func (l SimpleTaggedLog) PanicIfError(err error)

func (SimpleTaggedLog) Panicf added in v0.0.2

func (l SimpleTaggedLog) Panicf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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