Documentation ¶
Index ¶
- func AppendFilters(q *string, args *[]interface{}, queries *map[string]string, paging bool) error
- func ConcatMultipleSlices[T any](slices [][]T) []T
- func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) *model.Response
- func Format(i interface{})
- func GetQueryMap(r *http.Request, relevantQueries []string) *map[string]string
- func GetRelevantQueriesByTarget(target string) []string
- func GetTotalPages(totalItems, limit uint64) uint64
- func GetUintWithFallback(l string, fallback uint64) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendFilters ¶
AppendFilters according to the query map to the preoccupied database q. args has to be filled with the replacements for the SQL injection prevention done by the caller. The queries should already be filtered to only contain the relevant columns of the table. If not, this might result in a faulty q return.
func ConcatMultipleSlices ¶
func ConcatMultipleSlices[T any](slices [][]T) []T
func DecodeJSONBody ¶
Decode incoming JSON while doing extensive error handling.
func Format ¶
func Format(i interface{})
Format formats a given interface into a format useable by a requesting client. This is mostly dedicated to prepending ids from the database.
func GetRelevantQueriesByTarget ¶
Decide on target which queries to look at in further logic.
func GetTotalPages ¶
GetTotalPages calculates the total amount of pages.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.