Documentation
¶
Index ¶
- func CombineFlags(flags []int) uint64
- func ComparePasswords(storedHash, password string) error
- func EncryptPassword(password string) (string, error)
- func IsValidDateStr(dateStr string) bool
- func IsValidIso639_1(languageStr string) bool
- func ReadSVG(path string) string
- func SqlNullBoolToBool(nb sql.NullBool) bool
- func SqlNullBoolToString(nb sql.NullBool) string
- func SqlNullInt64ToInt(n sql.NullInt64) int64
- func SqlNullInt64ToString(n sql.NullInt64) string
- func SqlNullStringToString(ns sql.NullString) string
- func SqlNullTimeToString(nt sql.NullTime) string
- func TruncateAtWord(s string, maxLength int) string
- type Config
- type Uranus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineFlags ¶
CombineFlags takes a slice of integers representing flag positions and combines them into a single uint64 bitmask.
Each integer in the input slice should be in the range [0, 63], representing a bit position in the 64-bit unsigned integer. The function sets the bit at each of these positions to 1 in the result.
For example, if flags = []int{0, 2, 5}, the result will have bits 0, 2, and 5 set, resulting in a value like: 0b00100101.
Any flag values outside the range [0, 63] are ignored.
Parameters:
- flags: A slice of integers representing positions of individual flags.
Returns:
- A uint64 value with the corresponding bits set.
func ComparePasswords ¶
ComparePasswords compares a plain password with a bcrypt hash
func EncryptPassword ¶
EncryptPassword hashes a password and returns the hashed string along with any error
func IsValidDateStr ¶
func IsValidIso639_1 ¶
func SqlNullBoolToBool ¶
Utility function to extract bool from sql.NullBool
func SqlNullBoolToString ¶
Utility function to extract string from sql.NullBool
func SqlNullInt64ToInt ¶
Utility function to extract int64 from sql.NullInt64
func SqlNullInt64ToString ¶
Utility function to extract string from sql.NullInt64
func SqlNullStringToString ¶
func SqlNullStringToString(ns sql.NullString) string
Utility function to extract string from sql.NullString
func SqlNullTimeToString ¶
Utility function to extract time from sql.NullTime
func TruncateAtWord ¶
TruncateAtWord truncates the string at the word boundary
Types ¶
type Config ¶
type Config struct {
Verbose bool `json:"verbose"`
DevMode bool `json:"dev_mode"`
Port int `json:"port"`
BaseApiUrl string `json:"base_api_url"`
UseRouterMiddleware bool `json:"use_router_middleware"`
DbHost string `json:"db_host"`
DbPort int `json:"db_port"`
DbUser string `json:"db_user"`
DbPassword string `json:"db_password"`
DbName string `json:"db_name"`
DbSchema string `json:"db_schema"`
SSLMode string `json:"ssl_mode"`
AllowOrigins []string `json:"allow_origins"`
PlutoVerbose bool `json:"pluto_verbose"`
PlutoImageDir string `json:"pluto_image_dir"`
PlutoCacheDir string `json:"pluto_cache_dir"`
}
Config holds database configuration details
type Uranus ¶
var Singleton *Uranus
func (*Uranus) CloseAllDBs ¶
func (app *Uranus) CloseAllDBs()
func (*Uranus) DbErrorToHTTP ¶
Function to convert database errors to HTTP status codes