util

package
v0.0.0-...-73f3dc2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Database *sql.DB
View Source
var (
	GoogleClientID, GoogleClientSecret, GithubClientID, GithubClientSecret string
)

Functions

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, errval string, statusCode int)

func Init

func Init()

func LoadEnv

func LoadEnv(filename string) error

LoadEnv reads the .env file to set envrionment variables.

func PasswordEncrypt

func PasswordEncrypt(password []byte, cost int) ([]byte, error)

func ValidateFormFields

func ValidateFormFields(userName, email, password string) error

ValidateInput checks for the validity of input values provided via the form.

func ValidatePort

func ValidatePort() (string, error)

ValidatePort check for the validity of the choice of port used to run and access the program's server.

Types

type Message

type Message struct {
	Code       string
	ErrMessage string
}

Jump to

Keyboard shortcuts

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