env

package
v0.0.0-...-ef7a112 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequiredForEnv validator.Func = func(fl validator.FieldLevel) bool {
	s := fl.Field().String()
	if s == "" {
		return false
	}

	spl := strings.Split(s, "=")
	if len(spl) != 2 {
		return false
	}

	return spl[1] == GetString("ENV")
}

Functions

func GetBool

func GetBool(name string) bool

func GetDuration

func GetDuration(name string) time.Duration

func GetFloat64

func GetFloat64(name string) float64

func GetInt

func GetInt(name string) int

func GetInt64

func GetInt64(name string) int64

func GetSizeInBytes

func GetSizeInBytes(name string) uint

func GetString

func GetString(name string) string

func GetStringMap

func GetStringMap(name string) map[string]interface{}

func GetStringMapString

func GetStringMapString(name string) map[string]string

func GetStringMapStringSlice

func GetStringMapStringSlice(name string) map[string][]string

func GetStringSlice

func GetStringSlice(name string) []string

func GetTime

func GetTime(name string) time.Time

func RegisterValidation

func RegisterValidation(name string, tags ...string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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