Documentation ¶
Index ¶
- func HandleDelete(handler IHandler) func(http.ResponseWriter, *http.Request) (any, error)
- func HandleGet(handler IHandler) func(http.ResponseWriter, *http.Request) (any, error)
- func HandleGetById(handler IHandler) func(http.ResponseWriter, *http.Request) (any, error)
- func HandlePost(handler IHandler) func(http.ResponseWriter, *http.Request) (any, error)
- func HandlePut(handler IHandler) func(http.ResponseWriter, *http.Request) (any, error)
- func ParseFormAndQuery(request *http.Request) (map[string]interface{}, error)
- func ParseJSONBody(request *http.Request) (map[string]interface{}, error)
- func ParseMultipartFormFile(request *http.Request, formKey string) ([]byte, error)
- func ParseRequestData(request *http.Request) (map[string]interface{}, error)
- type IHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleDelete ¶
HandleDelete is a higher-order function that takes an IHandler as input and returns a function that handles a DELETE request.
func HandleGet ¶
HandleGet is a higher-order function that takes an IHandler as input and returns a function that handles a GET request.
func HandleGetById ¶
HandleGetById is a higher-order function that takes an IHandler as input and returns a function that handles a GET request by ID.
func HandlePost ¶
HandlePost is a higher-order function that takes an IHandler as input and returns a function that handles a POST request.
func HandlePut ¶
HandlePut is a higher-order function that takes an IHandler as input and returns a function that handles a PUT request.
func ParseFormAndQuery ¶
func ParseMultipartFormFile ¶
Types ¶
type IHandler ¶
type IHandler interface { GetAll() (any, error) GetById(id string) (any, error) Post(data map[string]any) (bool, string, error) Put(id string, data map[string]any) (bool, error) Delete(id string) (bool, error) }
IHandler is an interface for handling CRUD operations on a resource. It defines methods for retrieving, creating, updating, and deleting data.