utils

package
v0.0.0-...-16f37a6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Params = GetSettings()
	Users  = newClientCache()
)

Functions

func AuthAndRateLimiter

func AuthAndRateLimiter(next http.Handler, w http.ResponseWriter, r *http.Request)

func ExecuteQuery

func ExecuteQuery(query string, params ...any) error

func GenerateToken

func GenerateToken(length int) (string, error)

func HashPassword

func HashPassword(password string) (string, error)

func IPFormRestriction

func IPFormRestriction(ip string) (int, error)

func IsIpPrivate

func IsIpPrivate(remoteIP string) error

func IsSSL

func IsSSL() (string, string, bool)

func LinuxService

func LinuxService(src string) error

func SendEmailRequest

func SendEmailRequest(company, email, applicant string) error

func SubmitApplication

func SubmitApplication(w http.ResponseWriter, id string) error

func UpdateSettings

func UpdateSettings(b io.ReadCloser) error

Types

type SettingsStruct

type SettingsStruct struct {
	MU                 sync.RWMutex
	ServerPGSQL        string        `json:"serverPgsql"`
	PortPGSQL          string        `json:"portPgsql"`
	DatabasePGSQL      string        `json:"databasePgsql"`
	LoginPGSQL         string        `json:"loginPgsql"`
	PasswordPGSQL      string        `json:"passwordPgsql"`
	HTTPServer         string        `json:"httpServer"`
	HttpPort           string        `json:"httpPort"`
	UrlPort            string        `json:"urlPort"`
	HttpRedirectPrefix string        `json:"httpRedirectPrefix"`
	FileDirectory      string        `json:"fileDirectory"`
	RequestBlockMin    int64         `json:"requestBlockMin"`
	ConnLimit          int           `json:"connLimit"`
	UserTtlMin         time.Duration `json:"userTtlMin"`
	EmailTech          emailStruct   `json:"emailTech"`
	Tables             tableStruct   `json:"tables"`
}

func GetSettings

func GetSettings() *SettingsStruct

Jump to

Keyboard shortcuts

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