utils

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandom added in v0.7.1

func GenerateRandom(randomType Type) (string, error)

GenerateRandom generates a random string for either password or salt

func GenerateRandomLength added in v1.1.0

func GenerateRandomLength(length int, randomType Type) (string, error)

func HashPass

func HashPass(password string) string

HashPass hashes a password using a Whirlpool hash. Passwords are presumed to be hashed.

func NewCDN added in v1.1.0

func NewCDN(config CDNConfig) (*s3.S3, error)

NewCDN Initialise connection to CDN

func PSQL added in v0.7.1

func PSQL() sq.StatementBuilderType

Types

type CDNConfig added in v1.1.0

type CDNConfig struct {
	Endpoint        string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
}

CDNConfig represents a configuration to connect to a CDN / S3 instance

type Characters added in v1.1.0

type Characters string
const (
	UsernameCharacters Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	SaltCharacters     Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/."
	PasswordCharacters Characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@*()&"
)

type Length added in v1.1.0

type Length int
const (
	PasswordLength Length = 12
	SaltLength     Length = 22
	UsernameLength Length = 20
)

type NotInExpr added in v1.0.0

type NotInExpr inExpr

NotInExpr helps to use NOT IN in SQL query

func NotIn added in v1.0.0

func NotIn(column string, e any) NotInExpr

NotIn allows to use NOT IN in SQL query Ex: SelectBuilder.Where(NotIn("id", 1, 2, 3))

func (NotInExpr) ToSql added in v1.0.0

func (e NotInExpr) ToSql() (sql string, args []interface{}, err error)

type StringSQL added in v1.0.0

type StringSQL string

func (StringSQL) ToSql added in v1.0.0

func (s StringSQL) ToSql() (sql string, args []interface{}, err error)

type Type added in v0.7.1

type Type int
const (
	GeneratePassword Type = iota
	GenerateSalt
	GenerateUsername
)

Jump to

Keyboard shortcuts

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