Documentation ¶
Index ¶
- Constants
- type Controller
- func (controller *Controller) CanAccess(c *gin.Context)
- func (controller *Controller) CanDelete(c *gin.Context)
- func (controller *Controller) CanManage(c *gin.Context)
- func (controller *Controller) CanManageSpecial(c *gin.Context)
- func (controller *Controller) CanModify(c *gin.Context)
- func (controller *Controller) DeleteUser(c *gin.Context)
- func (controller *Controller) FeedbackBadRequest(c *gin.Context, errorFlag string, errorMessage string)
- func (controller *Controller) FeedbackInternalServerError(c *gin.Context, errorFlag string, errorMessage string)
- func (controller *Controller) FeedbackOK(c *gin.Context, resp model.Response)
- func (controller *Controller) ForgetPassword(c *gin.Context)
- func (controller *Controller) GetFirstStringParamValueFromURI(c *gin.Context, paramName string) (string, error)
- func (controller *Controller) GetIntParamFromRequest(c *gin.Context, paramName string) (int, error)
- func (controller *Controller) GetMagicIntParamFromRequest(c *gin.Context, paramName string) (int, error)
- func (controller *Controller) GetMyTeams(c *gin.Context)
- func (controller *Controller) GetStringParamFromHeader(c *gin.Context, paramName string) (string, error)
- func (controller *Controller) GetStringParamFromRequest(c *gin.Context, paramName string) (string, error)
- func (controller *Controller) GetStringParamValuesFromURI(c *gin.Context, paramName string) ([]string, error)
- func (controller *Controller) GetTargetTeamByIdentifier(c *gin.Context)
- func (controller *Controller) GetTargetUserByInternalRequest(c *gin.Context)
- func (controller *Controller) GetTargetUsersByInternalRequest(c *gin.Context)
- func (controller *Controller) GetTeamPermission(c *gin.Context)
- func (controller *Controller) GetUserAvatarUploadAddress(c *gin.Context)
- func (controller *Controller) GetUserIDFromAuth(c *gin.Context) (int, error)
- func (controller *Controller) GetVerificationCode(c *gin.Context)
- func (controller *Controller) Logout(c *gin.Context)
- func (controller *Controller) RetrieveUserByID(c *gin.Context)
- func (controller *Controller) SignIn(c *gin.Context)
- func (controller *Controller) Status(c *gin.Context)
- func (controller *Controller) TestFirstStringParamValueFromURI(c *gin.Context, paramName string) (string, error)
- func (controller *Controller) TestMagicIntParamFromRequest(c *gin.Context, paramName string) (int, error)
- func (controller *Controller) TestStringParamFromRequest(c *gin.Context, paramName string) (string, error)
- func (controller *Controller) UpdateAvatar(c *gin.Context)
- func (controller *Controller) UpdateIsTutorialViewed(c *gin.Context)
- func (controller *Controller) UpdateLanguage(c *gin.Context)
- func (controller *Controller) UpdateNickname(c *gin.Context)
- func (controller *Controller) UpdatePassword(c *gin.Context)
- func (controller *Controller) UpdateTeamConfig(c *gin.Context)
- func (controller *Controller) UpdateTeamPermission(c *gin.Context)
- func (controller *Controller) ValidateAccount(c *gin.Context)
- func (controller *Controller) ValidateRequestTokenFromHeader(c *gin.Context, input ...string) (bool, error)
- func (controller *Controller) ValidateRequestTokenFromHeaderByStringMap(c *gin.Context, input []string) (bool, error)
Constants ¶
View Source
const ( // validate failed ERROR_FLAG_VALIDATE_ACCOUNT_FAILED = "ERROR_FLAG_VALIDATE_ACCOUNT_FAILED" ERROR_FLAG_VALIDATE_REQUEST_BODY_FAILED = "ERROR_FLAG_VALIDATE_REQUEST_BODY_FAILED" ERROR_FLAG_VALIDATE_REQUEST_TOKEN_FAILED = "ERROR_FLAG_VALIDATE_REQUEST_TOKEN_FAILED" ERROR_FLAG_VALIDATE_REQUEST_PARAM_FAILED = "ERROR_FLAG_VALIDATE_REQUEST_PARAM_FAILED" ERROR_FLAG_VALIDATE_VERIFICATION_CODE_FAILED = "ERROR_FLAG_VALIDATE_VERIFICATION_CODE_FAILED" ERROR_FLAG_PARSE_REQUEST_BODY_FAILED = "ERROR_FLAG_PARSE_REQUEST_BODY_FAILED" ERROR_FLAG_PARSE_REQUEST_URI_FAILED = "ERROR_FLAG_PARSE_REQUEST_URI_FAILED" ERROR_FLAG_PARSE_INVITE_LINK_HASH_FAILED = "ERROR_FLAG_PARSE_INVITE_LINK_HASH_FAILED" ERROR_FLAG_CAN_NOT_TRANSFER_OWNER_TO_PENDING_USER = "ERROR_FLAG_CAN_NOT_TRANSFER_OWNER_TO_PENDING_USER" ERROR_FLAG_CAN_NOT_REMOVE_OWNER_FROM_TEAM = "ERROR_FLAG_CAN_NOT_REMOVE_OWNER_FROM_TEAM" ERROR_FLAG_SIGN_UP_EMAIL_MISMATCH = "ERROR_FLAG_SIGN_UP_EMAIL_MISMATCH" ERROR_FLAG_OWNER_ROLE_MUST_BE_TRANSFERED = "ERROR_FLAG_OWNER_ROLE_MUST_BE_TRANSFERED" ERROR_FLAG_PASSWORD_INVALIED = "ERROR_FLAG_PASSWORD_INVALIED" ERROR_FLAG_TEAM_MUST_TRANSFERED_BEFORE_USER_SUSPEND = "ERROR_FLAG_TEAM_MUST_TRANSFERED_BEFORE_USER_SUSPEND" ERROR_FLAG_INVITE_EMAIL_MISMATCH = "ERROR_FLAG_INVITE_EMAIL_MISMATCH" // can note create ERROR_FLAG_CAN_NOT_CREATE_USER = "ERROR_FLAG_CAN_NOT_CREATE_USER" ERROR_FLAG_CAN_NOT_CREATE_TEAM = "ERROR_FLAG_CAN_NOT_CREATE_TEAM" ERROR_FLAG_CAN_NOT_CREATE_TEAM_MEMBER = "ERROR_FLAG_CAN_NOT_CREATE_TEAM_MEMBER" ERROR_FLAG_CAN_NOT_CREATE_INVITE = "ERROR_FLAG_CAN_NOT_CREATE_INVITE" ERROR_FLAG_CAN_NOT_CREATE_INVITATION_CODE = "ERROR_FLAG_CAN_NOT_CREATE_INVITATION_CODE" ERROR_FLAG_CAN_NOT_CREATE_DOMAIN = "ERROR_FLAG_CAN_NOT_CREATE_DOMAIN" ERROR_FLAG_CAN_NOT_CREATE_ACTION = "ERROR_FLAG_CAN_NOT_CREATE_ACTION" ERROR_FLAG_CAN_NOT_CREATE_RESOURCE = "ERROR_FLAG_CAN_NOT_CREATE_RESOURCE" ERROR_FLAG_CAN_NOT_CREATE_APP = "ERROR_FLAG_CAN_NOT_CREATE_APP" // can not get resource ERROR_FLAG_CAN_NOT_GET_USER = "ERROR_FLAG_CAN_NOT_GET_USER" ERROR_FLAG_CAN_NOT_GET_TEAM = "ERROR_FLAG_CAN_NOT_GET_TEAM" ERROR_FLAG_CAN_NOT_GET_TEAM_MEMBER = "ERROR_FLAG_CAN_NOT_GET_TEAM_MEMBER" ERROR_FLAG_CAN_NOT_GET_INVITE = "ERROR_FLAG_CAN_NOT_GET_INVITE" ERROR_FLAG_CAN_NOT_GET_INVITATION_CODE = "ERROR_FLAG_CAN_NOT_GET_INVITATION_CODE" ERROR_FLAG_CAN_NOT_GET_DOMAIN = "ERROR_FLAG_CAN_NOT_GET_DOMAIN" ERROR_FLAG_CAN_NOT_GET_ACTION = "ERROR_FLAG_CAN_NOT_GET_ACTION" ERROR_FLAG_CAN_NOT_GET_RESOURCE = "ERROR_FLAG_CAN_NOT_GET_RESOURCE" ERROR_FLAG_CAN_NOT_GET_RESOURCE_META_INFO = "ERROR_FLAG_CAN_NOT_GET_RESOURCE_META_INFO" ERROR_FLAG_CAN_NOT_GET_APP = "ERROR_FLAG_CAN_NOT_GET_APP" ERROR_FLAG_CAN_NOT_GET_BUILDER_DESCRIPTION = "ERROR_FLAG_CAN_NOT_GET_BUILDER_DESCRIPTION" // can not update resource ERROR_FLAG_CAN_NOT_UPDATE_USER = "ERROR_FLAG_CAN_NOT_UPDATE_USER" ERROR_FLAG_CAN_NOT_UPDATE_TEAM = "ERROR_FLAG_CAN_NOT_UPDATE_TEAM" ERROR_FLAG_CAN_NOT_UPDATE_TEAM_MEMBER = "ERROR_FLAG_CAN_NOT_UPDATE_TEAM_MEMBER" ERROR_FLAG_CAN_NOT_UPDATE_INVITE = "ERROR_FLAG_CAN_NOT_UPDATE_INVITE" ERROR_FLAG_CAN_NOT_UPDATE_INVITATION_CODE = "ERROR_FLAG_CAN_NOT_UPDATE_INVITATION_CODE" ERROR_FLAG_CAN_NOT_UPDATE_DOMAIN = "ERROR_FLAG_CAN_NOT_UPDATE_DOMAIN" ERROR_FLAG_CAN_NOT_UPDATE_ACTION = "ERROR_FLAG_CAN_NOT_UPDATE_ACTION" ERROR_FLAG_CAN_NOT_UPDATE_RESOURCE = "ERROR_FLAG_CAN_NOT_UPDATE_RESOURCE" ERROR_FLAG_CAN_NOT_UPDATE_APP = "ERROR_FLAG_CAN_NOT_UPDATE_APP" // can not delete ERROR_FLAG_CAN_NOT_DELETE_USER = "ERROR_FLAG_CAN_NOT_DELETE_USER" ERROR_FLAG_CAN_NOT_DELETE_TEAM = "ERROR_FLAG_CAN_NOT_DELETE_TEAM" ERROR_FLAG_CAN_NOT_DELETE_TEAM_MEMBER = "ERROR_FLAG_CAN_NOT_DELETE_TEAM_MEMBER" ERROR_FLAG_CAN_NOT_DELETE_INVITE = "ERROR_FLAG_CAN_NOT_DELETE_INVITE" ERROR_FLAG_CAN_NOT_DELETE_INVITATION_CODE = "ERROR_FLAG_CAN_NOT_DELETE_INVITATION_CODE" ERROR_FLAG_CAN_NOT_DELETE_DOMAIN = "ERROR_FLAG_CAN_NOT_DELETE_DOMAIN" ERROR_FLAG_CAN_NOT_DELETE_ACTION = "ERROR_FLAG_CAN_NOT_DELETE_ACTION" ERROR_FLAG_CAN_NOT_DELETE_RESOURCE = "ERROR_FLAG_CAN_NOT_DELETE_RESOURCE" ERROR_FLAG_CAN_NOT_DELETE_APP = "ERROR_FLAG_CAN_NOT_DELETE_APP" // can not other operation ERROR_FLAG_CAN_NOT_CHECK_TEAM_MEMBER = "ERROR_FLAG_CAN_NOT_CHECK_TEAM_MEMBER" ERROR_FLAG_CAN_NOT_DUPLICATE_APP = "ERROR_FLAG_CAN_NOT_DUPLICATE_APP" ERROR_FLAG_CAN_NOT_RELEASE_APP = "ERROR_FLAG_CAN_NOT_RELEASE_APP" ERROR_FLAG_CAN_NOT_TEST_RESOURCE_CONNECTION = "ERROR_FLAG_CAN_NOT_TEST_RESOURCE_CONNECTION" // permission failed ERROR_FLAG_ACCESS_DENIED = "ERROR_FLAG_ACCESS_DENIED" ERROR_FLAG_TEAM_CLOSED_THE_PERMISSION = "ERROR_FLAG_TEAM_CLOSED_THE_PERMISSION" ERROR_FLAG_EMAIL_ALREADY_USED = "ERROR_FLAG_EMAIL_ALREADY_USED" ERROR_FLAG_EMAIL_HAS_BEEN_TAKEN = "ERROR_FLAG_EMAIL_HAS_BEEN_TAKEN" ERROR_FLAG_INVITATION_CODE_ALREADY_USED = "ERROR_FLAG_INVITATION_CODE_ALREADY_USED" ERROR_FLAG_INVITATION_LINK_UNAVALIABLE = "ERROR_FLAG_INVITATION_LINK_UNAVALIABLE" ERROR_FLAG_TEAM_IDENTIFIER_HAS_BEEN_TAKEN = "ERROR_FLAG_TEAM_IDENTIFIER_HAS_BEEN_TAKEN" ERROR_FLAG_USER_ALREADY_JOINED_TEAM = "ERROR_FLAG_USER_ALREADY_JOINED_TEAM" ERROR_FLAG_SIGN_IN_FAILED = "ERROR_FLAG_SIGN_IN_FAILED" ERROR_FLAG_NO_SUCH_USER = "ERROR_FLAG_NO_SUCH_USER" ERROR_FLAG_REGISTER_BLOCKED = "ERROR_FLAG_REGISTER_BLOCKED" // call resource failed ERROR_FLAG_SEND_EMAIL_FAILED = "ERROR_FLAG_SEND_EMAIL_FAILED" ERROR_FLAG_SEND_VERIFICATION_CODE_FAILED = "ERROR_FLAG_SEND_VERIFICATION_CODE_FAILED" ERROR_FLAG_CREATE_LINK_FAILED = "ERROR_FLAG_CREATE_LINK_FAILED" ERROR_FLAG_CREATE_UPLOAD_URL_FAILED = "ERROR_FLAG_CREATE_UPLOAD_URL_FAILED" ERROR_FLAG_EXECUTE_ACTION_FAILED = "ERROR_FLAG_EXECUTE_ACTION_FAILED" ERROR_FLAG_GENERATE_SQL_FAILED = "ERROR_FLAG_GENERATE_SQL_FAILED" // internal failed ERROR_FLAG_BUILD_TEAM_MEMBER_LIST_FAILED = "ERROR_FLAG_BUILD_TEAM_MEMBER_LIST_FAILED" ERROR_FLAG_BUILD_TEAM_CONFIG_FAILED = "ERROR_FLAG_BUILD_TEAM_CONFIG_FAILED" ERROR_FLAG_BUILD_TEAM_PERMISSION_FAILED = "ERROR_FLAG_BUILD_TEAM_PERMISSION_FAILED" ERROR_FLAG_BUILD_USER_INFO_FAILED = "ERROR_FLAG_BUILD_USER_INFO_FAILED" ERROR_FLAG_BUILD_APP_CONFIG_FAILED = "ERROR_FLAG_BUILD_APP_CONFIG_FAILED" ERROR_FLAG_GENERATE_PASSWORD_FAILED = "ERROR_FLAG_GENERATE_PASSWORD_FAILED" ERROR_FLAG_CAHCE_JWT_TOKEN_FAILED = "ERROR_FLAG_CAHCE_JWT_TOKEN_FAILED" ERROR_FLAG_CAN_NOT_FETCH_JWT_TOKEN_FROM_CACHE = "ERROR_FLAG_CAN_NOT_FETCH_JWT_TOKEN_FROM_CACHE" )
View Source
const DEFAULT_TEAM_ID = 0
View Source
const PARAM_APP_ID = "appID"
View Source
const PARAM_ATTRIBUTE_ID = "attributeID"
View Source
const PARAM_AUTHORIZATION_TOKEN = "Authorization-Token"
View Source
const PARAM_FILE_NAME = "fileName"
View Source
const PARAM_FROM_ID = "fromID"
View Source
const PARAM_INVITE_LINK_HASH = "inviteLinkHash"
View Source
const PARAM_REDIRECT_URL = "redirectURL"
View Source
const PARAM_REQUEST_TOKEN = "Request-Token"
View Source
const PARAM_TARGET_TEAM_IDENTIFIER = "teamIdentifier"
View Source
const PARAM_TARGET_TEAM_MEMBER_ID = "targetTeamMemberID"
View Source
const PARAM_TARGET_USER_ID = "targetUserID"
View Source
const PARAM_TARGET_USER_IDS = "targetUserIDs"
View Source
const PARAM_TEAM_ID = "teamID"
View Source
const PARAM_TO_ID = "toID"
View Source
const PARAM_UNIT_ID = "unitID"
View Source
const PARAM_UNIT_TYPE = "unitType"
View Source
const PARAM_USER_ID = "userID"
View Source
const PARAM_USER_ROLE = "userRole"
View Source
const PARAM_VERSION = "version"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { Storage *model.Storage Cache *model.Cache Drive *model.Drive RequestTokenValidator *tokenvalidator.RequestTokenValidator Authenticator *authenticator.Authenticator }
func NewController ¶
func NewController(storage *model.Storage, cache *model.Cache, drive *model.Drive, validator *tokenvalidator.RequestTokenValidator, auth *authenticator.Authenticator) *Controller
func (*Controller) CanAccess ¶
func (controller *Controller) CanAccess(c *gin.Context)
func (*Controller) CanDelete ¶
func (controller *Controller) CanDelete(c *gin.Context)
func (*Controller) CanManage ¶
func (controller *Controller) CanManage(c *gin.Context)
func (*Controller) CanManageSpecial ¶
func (controller *Controller) CanManageSpecial(c *gin.Context)
func (*Controller) CanModify ¶
func (controller *Controller) CanModify(c *gin.Context)
func (*Controller) DeleteUser ¶
func (controller *Controller) DeleteUser(c *gin.Context)
func (*Controller) FeedbackBadRequest ¶
func (controller *Controller) FeedbackBadRequest(c *gin.Context, errorFlag string, errorMessage string)
func (*Controller) FeedbackInternalServerError ¶
func (controller *Controller) FeedbackInternalServerError(c *gin.Context, errorFlag string, errorMessage string)
func (*Controller) FeedbackOK ¶
func (controller *Controller) FeedbackOK(c *gin.Context, resp model.Response)
func (*Controller) ForgetPassword ¶
func (controller *Controller) ForgetPassword(c *gin.Context)
func (*Controller) GetFirstStringParamValueFromURI ¶
func (*Controller) GetIntParamFromRequest ¶
func (*Controller) GetMagicIntParamFromRequest ¶
func (*Controller) GetMyTeams ¶
func (controller *Controller) GetMyTeams(c *gin.Context)
func (*Controller) GetStringParamFromHeader ¶
func (*Controller) GetStringParamFromRequest ¶
func (*Controller) GetStringParamValuesFromURI ¶
func (*Controller) GetTargetTeamByIdentifier ¶
func (controller *Controller) GetTargetTeamByIdentifier(c *gin.Context)
func (*Controller) GetTargetUserByInternalRequest ¶
func (controller *Controller) GetTargetUserByInternalRequest(c *gin.Context)
func (*Controller) GetTargetUsersByInternalRequest ¶
func (controller *Controller) GetTargetUsersByInternalRequest(c *gin.Context)
func (*Controller) GetTeamPermission ¶
func (controller *Controller) GetTeamPermission(c *gin.Context)
func (*Controller) GetUserAvatarUploadAddress ¶
func (controller *Controller) GetUserAvatarUploadAddress(c *gin.Context)
func (*Controller) GetUserIDFromAuth ¶
func (controller *Controller) GetUserIDFromAuth(c *gin.Context) (int, error)
@note: this param was setted by authenticator.JWTAuth() method
func (*Controller) GetVerificationCode ¶
func (controller *Controller) GetVerificationCode(c *gin.Context)
generate and send verification code email
func (*Controller) Logout ¶
func (controller *Controller) Logout(c *gin.Context)
func (*Controller) RetrieveUserByID ¶
func (controller *Controller) RetrieveUserByID(c *gin.Context)
func (*Controller) Status ¶
func (controller *Controller) Status(c *gin.Context)
func (*Controller) TestFirstStringParamValueFromURI ¶
func (*Controller) TestMagicIntParamFromRequest ¶
func (controller *Controller) TestMagicIntParamFromRequest(c *gin.Context, paramName string) (int, error)
test if Magic int exists in param, if not ,return 0 and an error.
func (*Controller) TestStringParamFromRequest ¶
func (*Controller) UpdateAvatar ¶
func (controller *Controller) UpdateAvatar(c *gin.Context)
func (*Controller) UpdateIsTutorialViewed ¶
func (controller *Controller) UpdateIsTutorialViewed(c *gin.Context)
func (*Controller) UpdateLanguage ¶
func (controller *Controller) UpdateLanguage(c *gin.Context)
func (*Controller) UpdateNickname ¶
func (controller *Controller) UpdateNickname(c *gin.Context)
func (*Controller) UpdatePassword ¶
func (controller *Controller) UpdatePassword(c *gin.Context)
func (*Controller) UpdateTeamConfig ¶
func (controller *Controller) UpdateTeamConfig(c *gin.Context)
func (*Controller) UpdateTeamPermission ¶
func (controller *Controller) UpdateTeamPermission(c *gin.Context)
func (*Controller) ValidateAccount ¶
func (controller *Controller) ValidateAccount(c *gin.Context)
func (*Controller) ValidateRequestTokenFromHeader ¶
func (*Controller) ValidateRequestTokenFromHeaderByStringMap ¶
Click to show internal directories.
Click to hide internal directories.