Documentation
¶
Index ¶
- func App() *config
- func ComparePassword(hashedPassword, password string) bool
- func ContainsElement(val interface{}, array interface{}) bool
- func CustomCronValidate()
- func CustomNoEmptyValidate()
- func CustomValidate()
- func DecrementRunning()
- 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 IncrementRunning()
- func LoadSQLQueries() (map[string]string, error)
- func RandomHex(length int) string
- func RandomString(length int) string
- func ReadJSON(w http.ResponseWriter, r *http.Request, data any) error
- func Render(w http.ResponseWriter, page string, data map[string]any, partials ...string) error
- func ShuttingWrapper(fn func())
- 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 ES
- type Kraft
- type Logger
- 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 CustomCronValidate ¶
func CustomCronValidate()
The Go Playground Validator has a “cron” validation mechanism, but it does not work correctly. So we will validate with “robfig/cron parser”.
func CustomNoEmptyValidate ¶
func CustomNoEmptyValidate()
The Go Playground Validator package does not have a validation tag that directly checks whether slices are empty. In the case of slices, this tag checks if the slice itself exists, but does not check if the contents of the slice are empty. We have written a special validation function to check if slices are empty.
func DecrementRunning ¶
func DecrementRunning()
func GetUserIDByToken ¶
func HasPrefixInList ¶
HasPrefixInList is a prefix checker
func HashAndSalt ¶
func IncrementRunning ¶
func IncrementRunning()
func LoadSQLQueries ¶
LoadSQLQueries loads SQL queries from a file and populates the QUERY map.
func RandomString ¶
func ShuttingWrapper ¶
func ShuttingWrapper(fn func())
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
type Kraft ¶
type Kraft struct {
// contains filtered or unexported fields
}
func (*Kraft) ConsumeMessages ¶
ConsumeMessages consumes messages from a Kafka topic