Documentation ¶
Index ¶
- func App() *config
- func ComparePassword(hashedPassword, password string) bool
- func ContainsElement(val interface{}, array interface{}) bool
- func GenerateToken(userId int) (string, error)
- func GetUserIDByToken(token string) (string, error)
- func HasPrefixInList(str string, prefixes []string) bool
- func HashAndSalt(password string) string
- func LoadSQLQueries() (map[string]string, error)
- func Logger(fileName string, logger *log.Logger)
- func RandomString(length int) string
- func ReadJSON(w http.ResponseWriter, r *http.Request, data any) error
- func RenderView(view templ.Component, w http.ResponseWriter) error
- func Validate(structure any) error
- func ValidateToken(token string) (*jwt.Token, error)
- func WriteJSON(w http.ResponseWriter, httpStatus int, data Response, headers ...http.Header) error
- type CKey
- type DB
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePassword ¶
func ContainsElement ¶
func ContainsElement(val interface{}, array interface{}) bool
ContainsElement checks if a value exists in a slice.
func GetUserIDByToken ¶
func HasPrefixInList ¶
HasPrefixInList is a prefix checker
func HashAndSalt ¶
func LoadSQLQueries ¶
LoadSQLQueries loads SQL queries from a file and populates the QUERY map.
func RandomString ¶
func RenderView ¶
func RenderView(view templ.Component, w http.ResponseWriter) error
func ValidateToken ¶
ValidateToken token validate
Types ¶
type DB ¶
func (*DB) CloseDatabase ¶
func (db *DB) CloseDatabase()
CloseDatabase method is closing a connection between your app and your db
func (*DB) ConnectDatabase ¶
func (db *DB) ConnectDatabase()
ConnectDatabase is creating a new connection to our database
Click to show internal directories.
Click to hide internal directories.