utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintfStdErr

func PrintfStdErr(format string, a ...any)

func PrintlnStdErr

func PrintlnStdErr(a ...any)

func ReplaceAnySchemeWithHttp

func ReplaceAnySchemeWithHttp(endpoint string) string

Types

type FuncUponAppExit added in v1.0.3

type FuncUponAppExit func()

FuncUponAppExit is a function that will be executed upon app exit. Panics will be ignored.

type IAppExitHelper added in v1.0.3

type IAppExitHelper interface {
	// RegisterFuncUponAppExit registers a function to be executed upon app exit.
	RegisterFuncUponAppExit(funcUponAppExit FuncUponAppExit)

	// ExecuteFunctionsUponAppExit executes all registered functions (LIFO) upon app exit.
	// Panics will be ignored and methods will be executed only once.
	ExecuteFunctionsUponAppExit()
}

IAppExitHelper is a helper to register and execute functions upon app exit.

var AppExitHelper IAppExitHelper = &appExitHelper{
	mutex:                        &sync.Mutex{},
	executedFunctionsUponAppExit: false,
	funcUponAppExit:              nil,
}

AppExitHelper is a helper to register and execute functions upon app exit.

Jump to

Keyboard shortcuts

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