utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv added in v1.1.0

func GetEnv(key, fallback string) string

func GetEnvBool added in v1.1.0

func GetEnvBool(key string, fallback bool) bool

func GetEnvInt added in v1.1.0

func GetEnvInt(key string, fallback int) int

func GetIntFromContext

func GetIntFromContext(c ContextGetter, key string) (int, error)

func GetIntFromContextParams added in v1.1.0

func GetIntFromContextParams(params ParamsGetter, key string) (int, error)

func Hash

func Hash(salt string, data string) string

func WrapErrors added in v1.2.0

func WrapErrors(err1, err2 error) error

Types

type ContextGetter added in v1.2.0

type ContextGetter interface {
	Get(key string) (interface{}, bool)
}

We introduce a ContextGetter instead of just using gin.Context to remove the dependency on gin

type ParamsGetter added in v1.2.0

type ParamsGetter interface {
	Get(name string) (string, bool)
}

We introduce a ParamsGetter instead of just using gin.Params to remove the dependency on gin

Jump to

Keyboard shortcuts

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