Documentation ¶
Index ¶
- Variables
- func EncodeJWT(id int64, issuer, secret string, expiry time.Duration) (string, error)
- func GetEnv(key string) (string, error)
- func GetIntEnv(key string) (int, error)
- func MustGetEnv(key string) string
- func MustGetIntEnv(key string) int
- func MustSetEnv(key, val string)
- func MustSetIntEnv(key string, val int)
- func ReadEnvFile(path string) error
- func SetEnv(key, val string) error
- func SetIntEnv(key string, val int) error
- func StrSliceContains(arr []string, val string) bool
- func StrSliceIntersects(a, b []string) []string
- func ValidateStruct(val interface{}) []error
- func ValidtateValue(val interface{}, tag string) []error
- type Envs
- func (e *Envs) Get(key string) (string, error)
- func (e *Envs) GetInt(key string) (int, error)
- func (e *Envs) MustGet(key string) string
- func (e *Envs) MustGetInt(key string) int
- func (e *Envs) MustSet(key, val string)
- func (e *Envs) MustSetInt(key string, val int)
- func (e *Envs) ReadFile(path string) error
- func (e *Envs) Set(key, val string) error
- func (e *Envs) SetInt(key string, val int) error
- type JWTClaims
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyKey = fmt.Errorf("env: empty key") ErrValueNotNumber = fmt.Errorf("env: the value is not a number") )
Functions ¶
func MustGetEnv ¶
func MustGetIntEnv ¶
func MustSetEnv ¶
func MustSetEnv(key, val string)
func MustSetIntEnv ¶
func ReadEnvFile ¶
func StrSliceContains ¶
func StrSliceIntersects ¶
func ValidateStruct ¶
func ValidateStruct(val interface{}) []error
func ValidtateValue ¶
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *Validator
Click to show internal directories.
Click to hide internal directories.