utl

package
v7.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIGTERM = unix.SIGTERM
	SIGHUP  = unix.SIGHUP
)

Variables

This section is empty.

Functions

func Basename

func Basename(path string) string

Basename returns trailing name component of path

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists

func GetEnv

func GetEnv(key, fallback string) string

GetEnv retrieves the value of the environment variable named by the key or fallback if not found

func GetSecret

func GetSecret(plaintext, filename string) (string, error)

GetSecret retrieves secret's value from plaintext or filename if defined

func Hash

func Hash(text string) string

Hash a string using SHA256

func MatchString

func MatchString(exp string, s string) bool

MatchString reports whether a string s contains any match of a regular expression.

func NewDuration

func NewDuration(duration time.Duration) *time.Duration

NewDuration returns a duration pointer

func NewFalse

func NewFalse() *bool

NewFalse returns a false bool pointer

func NewTrue

func NewTrue() *bool

NewTrue returns a true bool pointer

Types

This section is empty.

Jump to

Keyboard shortcuts

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