utils

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(s string) string

Capitalize returns a capitalized version of a string

func ContainsString

func ContainsString(s []string, v string) bool

ContainsString checks if `v` is present on slice `s`

func ReadEnvBool

func ReadEnvBool(key string) bool

ReadEnvBool read and parse boolean environment variables. Will return `false` if the variable is not a `bool`

func ReadEnvInt

func ReadEnvInt(key string) int

ReadEnvInt read an integer environment variables. Will return `0` if the variable is not an `int`

func ReadEnvString

func ReadEnvString(key string) string

ReadEnvString read string environment variables. This function is a wrapper function to 'os.Getenv()'

func ReadEnvStringArray added in v0.9.0

func ReadEnvStringArray(key string) []string

ReadEnvStringArray read an array of string environment variables. Must be comma-separated Automatically trims all values

func ReadEnvTime added in v0.16.0

func ReadEnvTime(key string) time.Duration

ReadEnvTime read and try to parse time duration from environment variables. If the value is parsable as an integer, it will use seconds as unit.

func RemoveEmptyStrings

func RemoveEmptyStrings(s []string) []string

RemoveEmptyStrings remove empty strings from a slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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