{"modulePath":"github.com/answerdev/answer","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package constant\n\n## Constants\n\n```go\nconst (\n\tActEdited    = \"edited\"\n\tActClosed    = \"closed\"\n\tActVotedDown = \"voted_down\"\n\tActVotedUp   = \"voted_up\"\n\tActVoteDown  = \"vote_down\"\n\tActVoteUp    = \"vote_up\"\n\tActUpVote    = \"upvote\"\n\tActDownVote  = \"downvote\"\n\tActFollow    = \"follow\"\n\tActAccepted  = \"accepted\"\n\tActAccept    = \"accept\"\n\tActPin       = \"pin\"\n\tActUnPin     = \"unpin\"\n\tActShow      = \"show\"\n\tActHide      = \"hide\"\n)\n```\n\n```go\nconst (\n\tUserStatusChangedCacheKey                  = \"answer:user:status:\"\n\tUserStatusChangedCacheTime                 = 7 * 24 * time.Hour\n\tUserTokenCacheKey                          = \"answer:user:token:\"\n\tUserTokenCacheTime                         = 7 * 24 * time.Hour\n\tUserVisitTokenCacheKey                     = \"answer:user:visit:\"\n\tUserVisitCacheTime                         = 7 * 24 * 60 * 60\n\tUserVisitCookiesCacheKey                   = \"visit\"\n\tAdminTokenCacheKey                         = \"answer:admin:token:\"\n\tAdminTokenCacheTime                        = 7 * 24 * time.Hour\n\tUserTokenMappingCacheKey                   = \"answer:user-token:mapping:\"\n\tSiteInfoCacheKey                           = \"answer:site-info:\"\n\tSiteInfoCacheTime                          = 1 * time.Hour\n\tConfigID2KEYCacheKeyPrefix                 = \"answer:config:id:\"\n\tConfigKEY2ContentCacheKeyPrefix            = \"answer:config:key:\"\n\tConfigCacheTime                            = 1 * time.Hour\n\tConnectorUserExternalInfoCacheKey          = \"answer:connector:\"\n\tConnectorUserExternalInfoCacheTime         = 10 * time.Minute\n\tSiteMapQuestionCacheKeyPrefix              = \"answer:sitemap:question:%d\"\n\tSiteMapQuestionCacheTime                   = time.Hour\n\tSitemapMaxSize                             = 50000\n\tNewQuestionNotificationLimitCacheKeyPrefix = \"answer:new-question-notification-limit:\"\n\tNewQuestionNotificationLimitCacheTime      = 7 * 24 * time.Hour\n\tNewQuestionNotificationLimitMax            = 50\n\tRateLimitCacheKeyPrefix                    = \"answer:rate-limit:\"\n\tRateLimitCacheTime                         = 5 * time.Minute\n)\n```\n\n```go\nconst (\n\tDefaultPageSize = 20 // Default number of pages\n\tDefaultBulkUser = 5000\n)\n```\n\n```go\nconst (\n\tAcceptLanguageFlag = \"Accept-Language\"\n\tShortIDFlag        = \"Short-ID-Enabled\"\n)\n```\n\n```go\nconst (\n\tEmailTplKeyChangeEmailTitle = \"email_tpl.change_email.title\"\n\tEmailTplKeyChangeEmailBody  = \"email_tpl.change_email.body\"\n\n\tEmailTplKeyNewAnswerTitle = \"email_tpl.new_answer.title\"\n\tEmailTplKeyNewAnswerBody  = \"email_tpl.new_answer.body\"\n\n\tEmailTplKeyNewCommentTitle = \"email_tpl.new_comment.title\"\n\tEmailTplKeyNewCommentBody  = \"email_tpl.new_comment.body\"\n\n\tEmailTplKeyPassResetTitle = \"email_tpl.pass_reset.title\"\n\tEmailTplKeyPassResetBody  = \"email_tpl.pass_reset.body\"\n\n\tEmailTplKeyRegisterTitle = \"email_tpl.register.title\"\n\tEmailTplKeyRegisterBody  = \"email_tpl.register.body\"\n\n\tEmailTplKeyTestTitle = \"email_tpl.test.title\"\n\tEmailTplKeyTestBody  = \"email_tpl.test.body\"\n\n\tEmailTplKeyInvitedAnswerTitle = \"email_tpl.invited_you_to_answer.title\"\n\tEmailTplKeyInvitedAnswerBody  = \"email_tpl.invited_you_to_answer.body\"\n\n\tEmailTplKeyNewQuestionTitle = \"email_tpl.new_question.title\"\n\tEmailTplKeyNewQuestionBody  = \"email_tpl.new_question.body\"\n)\n```\n\n```go\nconst (\n\t// NotificationUpdateQuestion update question\n\tNotificationUpdateQuestion = \"notification.action.update_question\"\n\t// NotificationAnswerTheQuestion answer the question\n\tNotificationAnswerTheQuestion = \"notification.action.answer_the_question\"\n\t// NotificationUpVotedTheQuestion up voted the question\n\tNotificationUpVotedTheQuestion = \"notification.action.up_voted_question\"\n\t// NotificationDownVotedTheQuestion down voted the question\n\tNotificationDownVotedTheQuestion = \"notification.action.down_voted_question\"\n\t// NotificationUpdateAnswer update answer\n\tNotificationUpdateAnswer = \"notification.action.update_answer\"\n\t// NotificationAcceptAnswer accept answer\n\tNotificationAcceptAnswer = \"notification.action.accept_answer\"\n\t// NotificationUpVotedTheAnswer up voted the answer\n\tNotificationUpVotedTheAnswer = \"notification.action.up_voted_answer\"\n\t// NotificationDownVotedTheAnswer down voted the answer\n\tNotificationDownVotedTheAnswer = \"notification.action.down_voted_answer\"\n\t// NotificationCommentQuestion comment question\n\tNotificationCommentQuestion = \"notification.action.comment_question\"\n\t// NotificationCommentAnswer comment answer\n\tNotificationCommentAnswer = \"notification.action.comment_answer\"\n\t// NotificationUpVotedTheComment up voted the comment\n\tNotificationUpVotedTheComment = \"notification.action.up_voted_comment\"\n\t// NotificationReplyToYou reply to you\n\tNotificationReplyToYou = \"notification.action.reply_to_you\"\n\t// NotificationMentionYou mention you\n\tNotificationMentionYou = \"notification.action.mention_you\"\n\t// NotificationYourQuestionIsClosed your question is closed\n\tNotificationYourQuestionIsClosed = \"notification.action.your_question_is_closed\"\n\t// NotificationYourQuestionWasDeleted your question was deleted\n\tNotificationYourQuestionWasDeleted = \"notification.action.your_question_was_deleted\"\n\t// NotificationYourAnswerWasDeleted your answer was deleted\n\tNotificationYourAnswerWasDeleted = \"notification.action.your_answer_was_deleted\"\n\t// NotificationYourCommentWasDeleted your comment was deleted\n\tNotificationYourCommentWasDeleted = \"notification.action.your_comment_was_deleted\"\n\t// NotificationInvitedYouToAnswer invited you to answer\n\tNotificationInvitedYouToAnswer = \"notification.action.invited_you_to_answer\"\n)\n```\n\n```go\nconst (\n\tQuestionObjectType   = \"question\"\n\tAnswerObjectType     = \"answer\"\n\tTagObjectType        = \"tag\"\n\tUserObjectType       = \"user\"\n\tCollectionObjectType = \"collection\"\n\tCommentObjectType    = \"comment\"\n\tReportObjectType     = \"report\"\n)\n```\n\n```go\nconst (\n\tRankQuestionAddKey               = \"rank.question.add\"\n\tRankQuestionEditKey              = \"rank.question.edit\"\n\tRankQuestionDeleteKey            = \"rank.question.delete\"\n\tRankQuestionVoteUpKey            = \"rank.question.vote_up\"\n\tRankQuestionVoteDownKey          = \"rank.question.vote_down\"\n\tRankAnswerAddKey                 = \"rank.answer.add\"\n\tRankAnswerEditKey                = \"rank.answer.edit\"\n\tRankAnswerDeleteKey              = \"rank.answer.delete\"\n\tRankAnswerAcceptKey              = \"rank.answer.accept\"\n\tRankAnswerVoteUpKey              = \"rank.answer.vote_up\"\n\tRankAnswerVoteDownKey            = \"rank.answer.vote_down\"\n\tRankInviteSomeoneToAnswerKey     = \"rank.answer.invite_someone_to_answer\"\n\tRankCommentAddKey                = \"rank.comment.add\"\n\tRankCommentEditKey               = \"rank.comment.edit\"\n\tRankCommentDeleteKey             = \"rank.comment.delete\"\n\tRankReportAddKey                 = \"rank.report.add\"\n\tRankTagAddKey                    = \"rank.tag.add\"\n\tRankTagEditKey                   = \"rank.tag.edit\"\n\tRankTagDeleteKey                 = \"rank.tag.delete\"\n\tRankTagSynonymKey                = \"rank.tag.synonym\"\n\tRankLinkUrlLimitKey              = \"rank.link.url_limit\"\n\tRankVoteDetailKey                = \"rank.vote.detail\"\n\tRankCommentVoteUpKey             = \"rank.comment.vote_up\"\n\tRankCommentVoteDownKey           = \"rank.comment.vote_down\"\n\tRankQuestionEditWithoutReviewKey = \"rank.question.edit_without_review\"\n\tRankAnswerEditWithoutReviewKey   = \"rank.answer.edit_without_review\"\n\tRankTagEditWithoutReviewKey      = \"rank.tag.edit_without_review\"\n\tRankAnswerAuditKey               = \"rank.answer.audit\"\n\tRankQuestionAuditKey             = \"rank.question.audit\"\n\tRankTagAuditKey                  = \"rank.tag.audit\"\n\tRankQuestionCloseKey             = \"rank.question.close\"\n\tRankQuestionReopenKey            = \"rank.question.reopen\"\n\tRankTagUseReservedTagKey         = \"rank.tag.use_reserved_tag\"\n)\n```\n\n```go\nconst (\n\tDefaultGravatarBaseURL = \"https://www.gravatar.com/avatar/\"\n\tDefaultAvatar          = \"system\"\n\tAvatarTypeDefault      = \"default\"\n\tAvatarTypeGravatar     = \"gravatar\"\n\tAvatarTypeCustom       = \"custom\"\n)\n```\n\n```go\nconst (\n\t// PermalinkQuestionIDAndTitle /questions/10010000000000001/post-title\n\tPermalinkQuestionIDAndTitle = iota + 1\n\t// PermalinkQuestionID /questions/10010000000000001\n\tPermalinkQuestionID\n\t// PermalinkQuestionIDAndTitleByShortID /questions/11/post-title\n\tPermalinkQuestionIDAndTitleByShortID\n\t// PermalinkQuestionIDByShortID /questions/11\n\tPermalinkQuestionIDByShortID\n)\n```\n\n```go\nconst (\n\tSiteTypeGeneral       = \"general\"\n\tSiteTypeInterface     = \"interface\"\n\tSiteTypeBranding      = \"branding\"\n\tSiteTypeWrite         = \"write\"\n\tSiteTypeLegal         = \"legal\"\n\tSiteTypeSeo           = \"seo\"\n\tSiteTypeLogin         = \"login\"\n\tSiteTypeCustomCssHTML = \"css-html\"\n\tSiteTypeTheme         = \"theme\"\n\tSiteTypePrivileges    = \"privileges\"\n\tSiteTypeUsers         = \"users\"\n)\n```\n\n```go\nconst (\n\tUserNormal    = \"normal\"\n\tUserSuspended = \"suspended\"\n\tUserDeleted   = \"deleted\"\n\tUserInactive  = \"inactive\"\n)\n```\n\n```go\nconst (\n\tEmailStatusAvailable    = 1\n\tEmailStatusToBeVerified = 2\n)\n```\n\n```go\nconst (\n\tCommentEditDeadline = time.Minute * 5\n)\n```\n\n```go\nconst (\n\tDeletedQuestionTitleTrKey = \"question.deleted_title\"\n)\n```\n\n```go\nconst (\n\tPluginStatus = \"plugin.status\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tVersion  string = \"\"\n\tRevision string = \"\"\n)\n```\n\n```go\nvar (\n\tObjectTypeStrMapping = map[string]int{\n\t\tQuestionObjectType:   1,\n\t\tAnswerObjectType:     2,\n\t\tTagObjectType:        3,\n\t\tUserObjectType:       4,\n\t\tCollectionObjectType: 6,\n\t\tCommentObjectType:    7,\n\t\tReportObjectType:     8,\n\t}\n\n\tObjectTypeNumberMapping = map[int]string{\n\t\t1: QuestionObjectType,\n\t\t2: AnswerObjectType,\n\t\t3: TagObjectType,\n\t\t4: UserObjectType,\n\t\t6: CollectionObjectType,\n\t\t7: CommentObjectType,\n\t\t8: ReportObjectType,\n\t}\n)\n```\n\n```go\nvar (\n\tNotificationMsgTypeMapping = map[string]int{\n\t\tNotificationUpdateQuestion:         1,\n\t\tNotificationAnswerTheQuestion:      1,\n\t\tNotificationUpVotedTheQuestion:     2,\n\t\tNotificationDownVotedTheQuestion:   2,\n\t\tNotificationUpdateAnswer:           1,\n\t\tNotificationAcceptAnswer:           1,\n\t\tNotificationUpVotedTheAnswer:       2,\n\t\tNotificationDownVotedTheAnswer:     2,\n\t\tNotificationCommentQuestion:        1,\n\t\tNotificationCommentAnswer:          1,\n\t\tNotificationUpVotedTheComment:      2,\n\t\tNotificationReplyToYou:             1,\n\t\tNotificationMentionYou:             1,\n\t\tNotificationYourQuestionIsClosed:   1,\n\t\tNotificationYourQuestionWasDeleted: 1,\n\t\tNotificationYourAnswerWasDeleted:   1,\n\t\tNotificationYourCommentWasDeleted:  1,\n\t\tNotificationInvitedYouToAnswer:     3,\n\t}\n)\n```\n\n```go\nvar (\n\tRankAllPrivileges = []*Privilege{\n\t\t{Label: reason.RankQuestionAddLabel, Key: RankQuestionAddKey},\n\t\t{Label: reason.RankAnswerAddLabel, Key: RankAnswerAddKey},\n\t\t{Label: reason.RankCommentAddLabel, Key: RankCommentAddKey},\n\t\t{Label: reason.RankReportAddLabel, Key: RankReportAddKey},\n\t\t{Label: reason.RankCommentVoteUpLabel, Key: RankCommentVoteUpKey},\n\t\t{Label: reason.RankLinkUrlLimitLabel, Key: RankLinkUrlLimitKey},\n\t\t{Label: reason.RankQuestionVoteUpLabel, Key: RankQuestionVoteUpKey},\n\t\t{Label: reason.RankAnswerVoteUpLabel, Key: RankAnswerVoteUpKey},\n\t\t{Label: reason.RankQuestionVoteDownLabel, Key: RankQuestionVoteDownKey},\n\t\t{Label: reason.RankAnswerVoteDownLabel, Key: RankAnswerVoteDownKey},\n\t\t{Label: reason.RankInviteSomeoneToAnswerLabel, Key: RankInviteSomeoneToAnswerKey},\n\t\t{Label: reason.RankTagAddLabel, Key: RankTagAddKey},\n\t\t{Label: reason.RankTagEditLabel, Key: RankTagEditKey},\n\t\t{Label: reason.RankQuestionEditLabel, Key: RankQuestionEditKey},\n\t\t{Label: reason.RankAnswerEditLabel, Key: RankAnswerEditKey},\n\t\t{Label: reason.RankQuestionEditWithoutReviewLabel, Key: RankQuestionEditWithoutReviewKey},\n\t\t{Label: reason.RankAnswerEditWithoutReviewLabel, Key: RankAnswerEditWithoutReviewKey},\n\t\t{Label: reason.RankQuestionAuditLabel, Key: RankQuestionAuditKey},\n\t\t{Label: reason.RankAnswerAuditLabel, Key: RankAnswerAuditKey},\n\t\t{Label: reason.RankTagAuditLabel, Key: RankTagAuditKey},\n\t\t{Label: reason.RankTagEditWithoutReviewLabel, Key: RankTagEditWithoutReviewKey},\n\t\t{Label: reason.RankTagSynonymLabel, Key: RankTagSynonymKey},\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc ConvertUserStatus(status, mailStatus int) string\n```\n\n## Types\n\n```go\ntype ActivityTypeKey string\n```\n\n```go\nconst (\n\tActQuestionAsked     ActivityTypeKey = \"question.asked\"\n\tActQuestionClosed    ActivityTypeKey = \"question.closed\"\n\tActQuestionReopened  ActivityTypeKey = \"question.reopened\"\n\tActQuestionAnswered  ActivityTypeKey = \"question.answered\"\n\tActQuestionCommented ActivityTypeKey = \"question.commented\"\n\tActQuestionAccept    ActivityTypeKey = \"question.accept\"\n\tActQuestionUpvote    ActivityTypeKey = \"question.upvote\"\n\tActQuestionDownVote  ActivityTypeKey = \"question.downvote\"\n\tActQuestionEdited    ActivityTypeKey = \"question.edited\"\n\tActQuestionRollback  ActivityTypeKey = \"question.rollback\"\n\tActQuestionDeleted   ActivityTypeKey = \"question.deleted\"\n\tActQuestionUndeleted ActivityTypeKey = \"question.undeleted\"\n\tActQuestionPin       ActivityTypeKey = \"question.pin\"\n\tActQuestionUnPin     ActivityTypeKey = \"question.unpin\"\n\tActQuestionHide      ActivityTypeKey = \"question.hide\"\n\tActQuestionShow      ActivityTypeKey = \"question.show\"\n)\n```\n\n```go\nconst (\n\tActAnswerAnswered  ActivityTypeKey = \"answer.answered\"\n\tActAnswerCommented ActivityTypeKey = \"answer.commented\"\n\tActAnswerAccept    ActivityTypeKey = \"answer.accept\"\n\tActAnswerUpvote    ActivityTypeKey = \"answer.upvote\"\n\tActAnswerDownVote  ActivityTypeKey = \"answer.downvote\"\n\tActAnswerEdited    ActivityTypeKey = \"answer.edited\"\n\tActAnswerRollback  ActivityTypeKey = \"answer.rollback\"\n\tActAnswerDeleted   ActivityTypeKey = \"answer.deleted\"\n\tActAnswerUndeleted ActivityTypeKey = \"answer.undeleted\"\n)\n```\n\n```go\nconst (\n\tActTagCreated   ActivityTypeKey = \"tag.created\"\n\tActTagEdited    ActivityTypeKey = \"tag.edited\"\n\tActTagRollback  ActivityTypeKey = \"tag.rollback\"\n\tActTagDeleted   ActivityTypeKey = \"tag.deleted\"\n\tActTagUndeleted ActivityTypeKey = \"tag.undeleted\"\n)\n```\n\n```go\ntype NotificationChannelKey string\n```\n\n```go\nconst (\n\tEmailChannel NotificationChannelKey = \"email\"\n)\n```\n\n```go\ntype NotificationSource string\n```\n\n```go\nconst (\n\tInboxSource                          NotificationSource = \"inbox\"\n\tAllNewQuestionSource                 NotificationSource = \"all_new_question\"\n\tAllNewQuestionForFollowingTagsSource NotificationSource = \"all_new_question_for_following_tags\"\n)\n```\n\n```go\ntype Privilege struct {\n\tKey   string `json:\"key\"`\n\tLabel string `json:\"label\"`\n\tValue int    `json:\"value\"`\n}\n```\n\n","path":"github.com/answerdev/answer/internal/base/constant","name":"constant","synopsis":"","isRedistributable":true}
