models

package
v0.0.0-...-6f6f875 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorCannotAccessRessource = "You can not access this ressource"

ErrorCannotAccessRessource = "You can not access this ressource" with 403 http.StatusForbidden

View Source
const ErrorIDDoesNotExist = "id does not exist"

ErrorIDDoesNotExist = "id does not exist" with 404 http.StatusNotFound

View Source
const ErrorIDIsMissing = "id is missing"

ErrorIDIsMissing = "id is missing" with 404 http.StatusNotFound

View Source
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

View Source
const ErrorRoleOfLoggedUser = "Could not get role of logged user"

ErrorRoleOfLoggedUser = "Could not get role of logged user" with 500 http.StatusInternalServerError

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL