Documentation ¶
Index ¶
- func ActiveClass(a, b int) string
- func App() *config
- func Clamp(value, min, max int) int
- func ComparePassword(hashedPassword, password string) bool
- func ContainsElement(val interface{}, array interface{}) bool
- func ConvertStringBoolsToBool(r *http.Request, columns ...string) ([]byte, error)
- func ConvertStringIDsToInt(r *http.Request, columns ...string) ([]byte, error)
- func CustomCronValidate()
- func CustomNoEmptyValidate()
- func CustomValidate()
- func DecrementRunning()
- func GenerateToken(userId int) (string, error)
- func GetIntQuery(r *http.Request, name string) int
- 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 MaptoJSON(response map[string]any) []byte
- func RandomHex(length int) string
- func RandomString(length int) string
- func ReadJSON(w http.ResponseWriter, r *http.Request, data any) error
- func ResponseToJSON(response Response) []byte
- func ShuttingWrapper(fn func())
- func StructToMap(obj interface{}) map[string]any
- func Validate(structure any) error
- func ValidateToken(token string) (*jwt.Token, error)
- func WriteBody(r *http.Request)
- 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 ActiveClass ¶
func ComparePassword ¶
func ContainsElement ¶
func ContainsElement(val interface{}, array interface{}) bool
ContainsElement checks if a value exists in a slice.
func ConvertStringBoolsToBool ¶
ConvertStringBoolsToBool converts specified string Bools in JSON data to bool
func ConvertStringIDsToInt ¶
ConvertStringIDsToInt converts specified string IDs in JSON data to integers
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 ResponseToJSON ¶
func ShuttingWrapper ¶
func ShuttingWrapper(fn func())
func StructToMap ¶
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