utl

package
v4.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SIGTERM = unix.SIGTERM
)

Variables

This section is empty.

Functions

func Contains added in v4.16.0

func Contains(s []string, e string) bool

Contains checks if a slice contains a string

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 IsExcluded

func IsExcluded(s string, excludes []string) bool

IsExcluded checks if s string is excluded in excludes If excludes is empty, assume false

func IsIncluded

func IsIncluded(s string, includes []string) bool

IsIncluded checks if s string is included in includes If includes is empty, assume true

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