Documentation ¶
Index ¶
Constants ¶
const ErrorCannotAccessRessource = "You can not access this ressource"
ErrorCannotAccessRessource = "You can not access this ressource" with 403 http.StatusForbidden
const ErrorIDDoesNotExist = "id does not exist"
ErrorIDDoesNotExist = "id does not exist" with 404 http.StatusNotFound
const ErrorIDIsMissing = "id is missing"
ErrorIDIsMissing = "id is missing" with 404 http.StatusNotFound
const ErrorNotAuthorizeMethodOnRessource = "You're not authorize to execute this method on this ressource."
ErrorNotAuthorizeMethodOnRessource = "You're not authorize to execute this method on this ressource." with 405 http.StatusMethodNotAllowed
const ErrorRoleOfLoggedUser = "Could not get role of logged user"
ErrorRoleOfLoggedUser = "Could not get role of logged user" with 500 http.StatusInternalServerError
const ErrorUserIDIsMissing = "id of UserClient is missing"
ErrorUserIDIsMissing = "id of UserClient is missing"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataHandler ¶
type DataHandler struct {
// contains filtered or unexported fields
}
DataHandler init a gorm DB an presents API handlers
func NewDataHandler ¶
func NewDataHandler() *DataHandler
NewDataHandler init a DataHandler and returns a pointer to it
func (*DataHandler) HandleSellers ¶
func (d *DataHandler) HandleSellers(w http.ResponseWriter, r *http.Request)
HandleSellers expose the UserClients API
func (*DataHandler) ProcessAPI ¶
func (d *DataHandler) ProcessAPI(w http.ResponseWriter, r *http.Request)
ProcessAPI redirect API call to DataHandler to each correct API func