helpers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsNil = errors.New("nil pointer")
)

Functions

func Expand added in v0.2.0

func Expand(v interface{}, values model.Values) (interface{}, bool, error)

Expand expands variables on any interface object

func ExpandEnvVars added in v0.2.0

func ExpandEnvVars(s string) (string, error)

ExpandEnvVars expands environment variables

func GetBoolEnv

func GetBoolEnv(v interface{}) (bool, error)

GetBoolEnv returns a boolean value based on the provided input

func GetEnumEnv

func GetEnumEnv(v interface{}, allowed []EnumEnvAllowedValues) (int, error)

GetEnumEnv returns an integer value based on the provided input

func NormalizeEOL added in v0.2.0

func NormalizeEOL(data []byte) []byte

func RemoveComments added in v0.2.0

func RemoveComments(data []byte) []byte

func Str2Bool added in v0.2.0

func Str2Bool(s string) (value bool, ok bool)

func ToBool added in v0.2.0

func ToBool(v interface{}) (value bool, isNil bool, ok bool)

func ToFloat added in v0.2.0

func ToFloat(v interface{}) (value float64, isNil bool, overflow bool, ok bool)

func ToInt added in v0.2.0

func ToInt(v interface{}, bitSize int) (value int64, isNil bool, overflow bool, ok bool)

func ToString added in v0.2.0

func ToString(v interface{}) (value string, isNil bool, ok bool)

func ToUint added in v0.2.0

func ToUint(v interface{}, bitSize int) (value uint64, isNil bool, overflow bool, ok bool)

Types

type EnumEnvAllowedValues

type EnumEnvAllowedValues struct {
	Name  string
	Value int
}

Jump to

Keyboard shortcuts

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