Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFields ¶
GetFields returns a list of fields for partial response after trimming spaces and making these unique.
func IsValidFields ¶
IsValidFields checks if a list of fields for partial response is valid. The fields parameter is a list of valid fields. The partial parameter is a string with the fields to validate. The function returns true if the fields are valid, false otherwise.
Example: IsValidFields(
[]string{"id", "first_name", "last_name", "email", "created_at", "updated_at"}, "id, first_name, last_name"
)
func IsValidFilter ¶
IsValidFilter checks if a filter string is valid SQL syntax. The columns parameter is a list of valid column names. The filter parameter is a string with the filter to validate. The function returns true if the filter is valid, false otherwise.
Example: IsValidFilter(
[]string{"id", "first_name", "last_name", "email", "created_at", "updated_at"}, "id=1 AND first_name='Alice'"
)
func IsValidSort ¶
IsValidSort checks if a sort string is valid SQL syntax. The columns parameter is a list of valid column names. The sort parameter is a string with the sort to validate. The function returns true if the sort is valid, false otherwise.
Example: IsValidSort(
[]string{"id", "first_name", "last_name", "email", "created_at", "updated_at"}, "id ASC, first_name DESC"
)
Types ¶
This section is empty.