util

package
v0.0.0-...-c29c528 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password, hashedPassword string) error

func HashPassword

func HashPassword(password string) (string, error)

func RandomInt

func RandomInt() int32

func RandomString

func RandomString(length int) string

func RandomUsername

func RandomUsername() string

Types

type Config

type Config struct {
	DBDriver             string        `mapstructure:"DB_DRIVER"`
	DBSource             string        `mapstructure:"DB_SOURCE"`
	ServerAddress        string        `mapstructure:"SERVER_ADDRESS"`
	VesApiUrl            string        `mapstructure:"VES_API_URL"`
	VesApiKey            string        `mapstructure:"VES_API_KEY"`
	AllowedOriginsStr    string        `mapstructure:"ALLOWED_ORIGINS"`
	TokenSecret          string        `mapstructure:"TOKEN_SECRET"`
	AccessTokenDuration  time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"`
	RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"`
	EmailApiKey          string        `mapstructure:"EMAIL_API_KEY"`
	Email                string        `mapstructure:"EMAIL"`
	GatewayApiUrl        string        `mapstructure:"GATEWAY_API_URL"`
	GatewayApiToken      string        `mapstructure:"GATEWAY_API_TOKEN"`
	CompanyName          string        `mapstructure:"COMPANY_NAME"`
	DvsaAuthUrl          string        `mapstructure:"DVSA_AUTH_URL"`
	DvsaUrl              string        `mapstructure:"DVSA_URL"`
	DvsaClientId         string        `mapstructure:"DVSA_CLIENT_ID"`
	DvsaClientSecret     string        `mapstructure:"DVSA_CLIENT_SECRET"`
	DvsaScope            string        `mapstructure:"DVSA_SCOPE"`
	DvsaApiKey           string        `mapstructure:"DVSA_API_KEY"`
	AllowedOrigins       []string
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

Jump to

Keyboard shortcuts

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