Documentation
¶
Index ¶
- func CheckAuthToken(token string) bool
- func CheckEndpointIntegrity(endpoint *models.Endpoint) bool
- func CheckMethodAndParseContent(r *http.Request) (error, int)
- func CheckNotNull(data []byte) bool
- func CheckUserExists(user *models.User) bool
- func CheckUserIntegrity(user *models.User) bool
- func CheckUserSessionIntegrity(userSession *models.UserSession) bool
- func GetIdFromParams(reqForm url.Values) (bson.ObjectId, error, bool)
- func GetIdValueFromParams(paramName string, reqForm url.Values) (bson.ObjectId, error, bool)
- func GetIntValueFromParams(paramName string, reqForm url.Values) (int, error, bool)
- func GetStringValueFromParams(paramName string, reqForm url.Values) (string, error, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAuthToken ¶
Checks if the session exists and if the user that is allocated for that session also exists
func CheckEndpointIntegrity ¶
Checks if the user entity has all the mandatory fields populated with any kind of data
func CheckMethodAndParseContent ¶
Function for filtering HTTP requests. This checks if POSTs and PUTs have any kind of content (contentLength != 0). If yes, then it tries parsing Form/PostForm in order for the Form, MultipartForm and Body to be readable. If this fails, an error is returned
This returns and error and a status code. A nil error and -1 status code means that the parsing went just fine.
func CheckNotNull ¶
Checks whether the array of bytes parameter is either empty or has the string value "null" stored.
func CheckUserExists ¶
Checks whether the user already exists or not
func CheckUserIntegrity ¶
Checks if the user entity has all the mandatory fields populated with any kind of data
func CheckUserSessionIntegrity ¶
func CheckUserSessionIntegrity(userSession *models.UserSession) bool
Checks if the user entity has all the mandatory fields populated with any kind of data
func GetIdFromParams ¶
Gets a parameter from the HTTP request with the specified name and tries to parse it as an bson.ObjectId value, then return it
func GetIdValueFromParams ¶
func GetIntValueFromParams ¶
Gets a parameter from the HTTP request with the specified name and tries to parse it as an integer value, then return it
Types ¶
This section is empty.