utils

package
v0.0.0-...-a6acc86 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProjectContextKeys = ContextKeys{
	GothicProviderCtxKey: "provider",
	ProviderCtxKey:       "gg-provider",
	UserCtxKey:           "gg-auth-user",
}

ProjectContextKeys the project's context keys

Functions

func EmailCheck

func EmailCheck(email string) (err error)

EmailCheck checks the correct formatting of an email

func GetEnv

func GetEnv(k string) string

GetEnv will return the env or empty string

func HashPassword

func HashPassword(passw string) (string, error)

HashPassword hash the password with bcrypt

func MustGet

func MustGet(k string) string

MustGet will return the env or panic if it is not present

func MustGetBool

func MustGetBool(k string) bool

MustGetBool will return the env as boolean or panic if it is not present

func MustGetInt32

func MustGetInt32(k string) int

MustGetInt32 will return the env as int32 or panic if it is not present

func MustGetInt64

func MustGetInt64(k string) int64

MustGetInt64 will return the env as int64 or panic if it is not present

func PasswordCheck

func PasswordCheck(hashedPasswd string, passw string) (err error)

PasswordCheck compares a password hash with what we have stored

func StrToPtrStr

func StrToPtrStr(str string) *string

StrToPtrStr return a pointer to the input string

Types

type ContextKey

type ContextKey string

ContextKey defines a type for context keys shared in the app

type ContextKeys

type ContextKeys struct {
	GothicProviderCtxKey ContextKey // Provider for Gothic library
	ProviderCtxKey       ContextKey // Provider in Auth
	UserCtxKey           ContextKey // User db object in Auth
}

ContextKeys holds the context keys throughout the project

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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