Documentation ¶
Index ¶
- func CreateToken(userId string, secretKey string) (string, error)
- func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error
- func FloatToString(value float64) string
- func FormatTimeToHHMMAMOrPM(t time.Time) string
- func FormatTimeToYYYYMMDD(t time.Time) string
- func GeneratePDF(travelExpense *db.TravelExpense, fuel *db.Fuel) ([]byte, error)
- func GeneratePassword(password string) (string, error)
- func IntToString(value int) string
- func IsAdmin(role string) bool
- func IsArrayEmpty[T any](arr []T) bool
- func IsDiesel(fuelType string) bool
- func IsEmpty(s string) bool
- func IsGasoline(fuelType string) bool
- func IsGeneral(role string) bool
- func IsManager(role string) bool
- func IsProduction(cfg *config.Config) bool
- func IsValidFuelType(fuelType string) bool
- func IsValidRole(role string) bool
- func NewErrorResponse(w http.ResponseWriter, statusCode int, message string)
- func ParseJSON(w http.ResponseWriter, data interface{}) error
- func ParseToken(token *jwt.Token, secretKey string) (string, error)
- func ResponseHandler[T any](w http.ResponseWriter, statusCode int, response T)
- func VerifyPassword(password string, hash string) bool
- func VerifyToken(tokenString string, secretKey string) (*jwt.Token, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONBody ¶
func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error
func FloatToString ¶
func FormatTimeToHHMMAMOrPM ¶
func FormatTimeToYYYYMMDD ¶
func GeneratePDF ¶
func GeneratePassword ¶
func IntToString ¶
func IsArrayEmpty ¶
func IsGasoline ¶
func IsProduction ¶
func IsValidFuelType ¶
func IsValidRole ¶
func NewErrorResponse ¶
func NewErrorResponse(w http.ResponseWriter, statusCode int, message string)
func ParseJSON ¶
func ParseJSON(w http.ResponseWriter, data interface{}) error
func ParseToken ¶
func ResponseHandler ¶
func ResponseHandler[T any](w http.ResponseWriter, statusCode int, response T)
func VerifyPassword ¶
func VerifyToken ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.