Documentation ¶
Index ¶
- Constants
- func ConnectFaceRecognitionRoutes(router *mux.Router, logger *log.Logger, faceServerHost string, ...)
- func LogError(logger *log.Logger, err error, endpoint string)
- func LogWarning(logger *log.Logger, warning string, endpoint string)
- func WriteJSON(w http.ResponseWriter, value interface{}) error
- func WriteJSONError(w http.ResponseWriter, errorName string) error
- func WriteJSONSuccess(w http.ResponseWriter, response interface{}) error
- type ErrorJSON
- type SuccessJSON
Constants ¶
const ErrorBadParams = "BadParams"
ErrorBadParams paramaters wrong
const ErrorNotAuthenticated = "NotAuthenticated"
ErrorNotAuthenticated user not authenticated
const ErrorNotAuthorized = "NotAuthorized"
ErrorNotAuthorized user not authorized
const ErrorNotFound = "NotFound"
ErrorNotFound data not found
const ErrorSessionTimeout = "SessionTimeout"
ErrorSessionTimeout user session timedout
const ErrorUnknown = "Unknown"
ErrorUnknown unknown error
Variables ¶
This section is empty.
Functions ¶
func ConnectFaceRecognitionRoutes ¶
func ConnectFaceRecognitionRoutes(router *mux.Router, logger *log.Logger, faceServerHost string, faceServerPort int, faceRootDir string)
ConnectFaceRecognitionRoutes creates controller for face recognition
func LogWarning ¶
LogWarning logs a warning
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, value interface{}) error
WriteJSON returns json message to http client
func WriteJSONError ¶
func WriteJSONError(w http.ResponseWriter, errorName string) error
WriteJSONError returns error json message to http client
func WriteJSONSuccess ¶
func WriteJSONSuccess(w http.ResponseWriter, response interface{}) error
WriteJSONSuccess returns success json message to http client
Types ¶
type ErrorJSON ¶
ErrorJSON response for web service call errors
func NewErrorJSON ¶
NewErrorJSON creates ErrorJSON stuct with proper defaults
type SuccessJSON ¶
type SuccessJSON struct { Success bool `json:"success"` Response interface{} `json:"response"` }
SuccessJSON response for web service calls
func NewSuccessJSON ¶
func NewSuccessJSON(response interface{}) SuccessJSON
NewSuccessJSON creates SuccessJSON stuct with proper defaults