util

package
v0.0.0-...-3fd17bc Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hashedPassowrd string) error

CheckPassword checks if password and hashedpassword are the same.

func HashPassword

func HashPassword(password string) (string, error)

HashPassword returns the bcrypt hash of the password and an error.

func RandomEmail

func RandomEmail(n int) string

RandomEmail generates a random email address

func RandomInt

func RandomInt(min, max int64) int64

RandomInt generates a random integer between min and max

func RandomMoney

func RandomMoney() int64

RandomMoney generates a random amount of money

func RandomStr

func RandomStr(n int) string

RandomStr generates a random string of length n

func RandomUser

func RandomUser() string

RandomOwner generates a random owner name

func ValidQuery

func ValidQuery(query string) bool

ValidQuery checks if parsed SQL Query is a valid query a valid query in this case is a correct SQL which is also a SELECT statement. It adds extra security to ensure only SELECT queries are validated.

Types

type Config

type Config struct {
	Port                string
	DBDriver            string
	DBUrl               string
	DBName              string
	Environment         string
	TokenSymmetricKey   string
	TokenSecretKey      string
	AccessTokenDuration time.Duration
	ApiKey              string
	OrgId               string
	ProjectId           string
	Model               string
	Temp                string
	CronSchedule        string
	CronBatchSize       string
	LogPath             string
}

func LoadConfig

func LoadConfig(path string) (config Config, err error)

Jump to

Keyboard shortcuts

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