util

package
v0.0.0-...-e14225d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, v ...any)

func Error

func Error(format string, v ...any)

func Fatal

func Fatal(format string, v ...any)

func Info

func Info(format string, v ...any)

func InitLogger

func InitLogger(writer io.Writer)

func Log

func Log(aktLevel LogLevel, format string, v ...any) string

func SetLogLevel

func SetLogLevel(newLevel LogLevel)

func SetLogLevelByName

func SetLogLevelByName(newLevelName string)

func Warn

func Warn(format string, v ...any)

Types

type ChainContext

type ChainContext struct {
	Err error
}

func (*ChainContext) Chain

func (ctx *ChainContext) Chain(f func()) *ChainContext

func (*ChainContext) ChainError

func (ctx *ChainContext) ChainError(label string)

func (*ChainContext) ChainFatal

func (ctx *ChainContext) ChainFatal(label string)

type LogLevel

type LogLevel int32
const (
	LOG_DEBUG LogLevel = iota
	LOG_INFO
	LOG_WARN
	LOG_ERROR
	LOG_FATAL
	LOG_NONE
)

type PathInfo

type PathInfo struct {
	IsDir     bool
	IsSymlink bool
	Target    string
}

PathInfo distilles information from FileInfo and Readlink

func Stat

func Stat(path string) PathInfo

Stat checks if a path is a directory, a symlink or otherwise a regular file.

Jump to

Keyboard shortcuts

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