utils

package
v0.0.0-...-f6bba44 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckifStringIsEmpty

func CheckifStringIsEmpty(data string) bool

Check if a string is empty returns True if string is a string

func Danger

func Danger(e error)

func LogErrorToFile

func LogErrorToFile(name string, text ...interface{}) error

Log and error to file Allows format string input

func LogErrorToNamedFileInDir

func LogErrorToNamedFileInDir(name, dir string, text ...interface{})

func Logerror

func Logerror(e error)

log error of errors

func Notice

func Notice(text string)

func PrintInformation

func PrintInformation(text string)

func PrintTextInASpecificColorInBold

func PrintTextInASpecificColorInBold(colorName, text string)

func RandLetters

func RandLetters(length int) string

Returns A Random letters

func RandNo

func RandNo(length int) string

Returns a random number in string format

func RandNoLetter

func RandNoLetter(length int) string

Retrns a random string with numbers and letters (caps on)

func RandString

func RandString(length int) string

func Start

func Start(l RequestLogger) http.Handler

func TrueRand

func TrueRand(len int) string

func Warning

func Warning(text string)

Types

type ErrorLogger

type ErrorLogger struct {
	Filename string
	Dir      string
	Perm     fs.FileMode
	Text     interface{}
}

type RequestLogger

type RequestLogger struct {
	FileName string
	Dir      string
	Perm     fs.FileMode
	Handle   http.Handler
}

func (RequestLogger) LogRequest

func (l RequestLogger) LogRequest(handler http.Handler) http.Handler

func (RequestLogger) OpenLogFile

func (l RequestLogger) OpenLogFile()

opens or creates a file for logging To be addedfile permisions

Jump to

Keyboard shortcuts

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