constant

package
v1.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActEdited    = "edited"
	ActClosed    = "closed"
	ActVotedDown = "voted_down"
	ActVotedUp   = "voted_up"
	ActVoteDown  = "vote_down"
	ActVoteUp    = "vote_up"
	ActUpVote    = "upvote"
	ActDownVote  = "downvote"
	ActFollow    = "follow"
	ActAccepted  = "accepted"
	ActAccept    = "accept"
	ActPin       = "pin"
	ActUnPin     = "unpin"
	ActShow      = "show"
	ActHide      = "hide"
)
View Source
const (
	ConnectorUserExternalInfoCacheKey  = "answer:connector:"
	ConnectorUserExternalInfoCacheTime = 10 * time.Minute
)
View Source
const (
	DefaultPageSize            = 20 // Default number of pages
	UserStatusChangedCacheKey  = "answer:user:status:"
	UserStatusChangedCacheTime = 7 * 24 * time.Hour
	UserTokenCacheKey          = "answer:user:token:"
	UserTokenCacheTime         = 7 * 24 * time.Hour
	AdminTokenCacheKey         = "answer:admin:token:"
	AdminTokenCacheTime        = 7 * 24 * time.Hour
	AcceptLanguageFlag         = "Accept-Language"
	UserTokenMappingCacheKey   = "answer:user-token:mapping:"
	SiteInfoCacheKey           = "answer:site-info:"
	SiteInfoCacheTime          = 1 * time.Hour
)
View Source
const (
	QuestionObjectType   = "question"
	AnswerObjectType     = "answer"
	TagObjectType        = "tag"
	UserObjectType       = "user"
	CollectionObjectType = "collection"
	CommentObjectType    = "comment"
	ReportObjectType     = "report"
)
View Source
const (
	SiteTypeGeneral       = "general"
	SiteTypeInterface     = "interface"
	SiteTypeBranding      = "branding"
	SiteTypeWrite         = "write"
	SiteTypeLegal         = "legal"
	SiteTypeSeo           = "seo"
	SiteTypeLogin         = "login"
	SiteTypeCustomCssHTML = "css-html"
	SiteTypeTheme         = "theme"
	SiteTypePrivileges    = "privileges"
	SiteTypeUsers         = "users"
)
View Source
const (
	// NotificationUpdateQuestion update question
	NotificationUpdateQuestion = "notification.action.update_question"
	// NotificationAnswerTheQuestion answer the question
	NotificationAnswerTheQuestion = "notification.action.answer_the_question"
	// NotificationUpVotedTheQuestion up voted the question
	NotificationUpVotedTheQuestion = "notification.action.up_voted_question"
	// NotificationDownVotedTheQuestion down voted the question
	NotificationDownVotedTheQuestion = "notification.action.down_voted_question"
	// NotificationUpdateAnswer update answer
	NotificationUpdateAnswer = "notification.action.update_answer"
	// NotificationAcceptAnswer accept answer
	NotificationAcceptAnswer = "notification.action.accept_answer"
	// NotificationUpVotedTheAnswer up voted the answer
	NotificationUpVotedTheAnswer = "notification.action.up_voted_answer"
	// NotificationDownVotedTheAnswer down voted the answer
	NotificationDownVotedTheAnswer = "notification.action.down_voted_answer"
	// NotificationCommentQuestion comment question
	NotificationCommentQuestion = "notification.action.comment_question"
	// NotificationCommentAnswer comment answer
	NotificationCommentAnswer = "notification.action.comment_answer"
	// NotificationUpVotedTheComment up voted the comment
	NotificationUpVotedTheComment = "notification.action.up_voted_comment"
	// NotificationReplyToYou reply to you
	NotificationReplyToYou = "notification.action.reply_to_you"
	// NotificationMentionYou mention you
	NotificationMentionYou = "notification.action.mention_you"
	// NotificationYourQuestionIsClosed your question is closed
	NotificationYourQuestionIsClosed = "notification.action.your_question_is_closed"
	// NotificationYourQuestionWasDeleted your question was deleted
	NotificationYourQuestionWasDeleted = "notification.action.your_question_was_deleted"
	// NotificationYourAnswerWasDeleted your answer was deleted
	NotificationYourAnswerWasDeleted = "notification.action.your_answer_was_deleted"
	// NotificationYourCommentWasDeleted your comment was deleted
	NotificationYourCommentWasDeleted = "notification.action.your_comment_was_deleted"
)
View Source
const (
	RankQuestionAddKey               = "rank.question.add"
	RankQuestionEditKey              = "rank.question.edit"
	RankQuestionDeleteKey            = "rank.question.delete"
	RankQuestionVoteUpKey            = "rank.question.vote_up"
	RankQuestionVoteDownKey          = "rank.question.vote_down"
	RankAnswerAddKey                 = "rank.answer.add"
	RankAnswerEditKey                = "rank.answer.edit"
	RankAnswerDeleteKey              = "rank.answer.delete"
	RankAnswerAcceptKey              = "rank.answer.accept"
	RankAnswerVoteUpKey              = "rank.answer.vote_up"
	RankAnswerVoteDownKey            = "rank.answer.vote_down"
	RankCommentAddKey                = "rank.comment.add"
	RankCommentEditKey               = "rank.comment.edit"
	RankCommentDeleteKey             = "rank.comment.delete"
	RankReportAddKey                 = "rank.report.add"
	RankTagAddKey                    = "rank.tag.add"
	RankTagEditKey                   = "rank.tag.edit"
	RankTagDeleteKey                 = "rank.tag.delete"
	RankTagSynonymKey                = "rank.tag.synonym"
	RankLinkUrlLimitKey              = "rank.link.url_limit"
	RankVoteDetailKey                = "rank.vote.detail"
	RankCommentVoteUpKey             = "rank.comment.vote_up"
	RankCommentVoteDownKey           = "rank.comment.vote_down"
	RankQuestionEditWithoutReviewKey = "rank.question.edit_without_review"
	RankAnswerEditWithoutReviewKey   = "rank.answer.edit_without_review"
	RankTagEditWithoutReviewKey      = "rank.tag.edit_without_review"
	RankAnswerAuditKey               = "rank.answer.audit"
	RankQuestionAuditKey             = "rank.question.audit"
	RankTagAuditKey                  = "rank.tag.audit"
	RankQuestionCloseKey             = "rank.question.close"
	RankQuestionReopenKey            = "rank.question.reopen"
	RankTagUseReservedTagKey         = "rank.tag.use_reserved_tag"
)
View Source
const (
	ReportSpamName             = "report.spam.name"
	ReportSpamDescription      = "report.spam.description"
	ReportRudeName             = "report.rude.name"
	ReportRudeDescription      = "report.rude.description"
	ReportDuplicateName        = "report.duplicate.name"
	ReportDuplicateDescription = "report.duplicate.description"
	ReportOtherName            = "report.other.name"
	ReportOtherDescription     = "report.other.description"
	ReportNotAnswerName        = "report.not_answer.name"
	ReportNotAnswerDescription = "report.not_answer.description"
	ReportNotNeedName          = "report.not_need.name"
	ReportNotNeedDescription   = "report.not_need.description"
	// question close
	QuestionCloseDuplicateName        = "question.close.duplicate.name"
	QuestionCloseDuplicateDescription = "question.close.duplicate.description"
	QuestionCloseGuidelineName        = "question.close.guideline.name"
	QuestionCloseGuidelineDescription = "question.close.guideline.description"
	QuestionCloseMultipleName         = "question.close.multiple.name"
	QuestionCloseMultipleDescription  = "question.close.multiple.description"
	QuestionCloseOtherName            = "question.close.other.name"
	QuestionCloseOtherDescription     = "question.close.other.description"
)
View Source
const (
	// TODO put this in database
	// TODO need reason controller to resolve
	QuestionCloseJSON  = `` /* 649-byte string literal not displayed */
	QuestionReportJSON = `` /* 567-byte string literal not displayed */
	AnswerReportJSON   = `` /* 558-byte string literal not displayed */
	CommentReportJSON  = `` /* 561-byte string literal not displayed */
)
View Source
const (
	CommentEditDeadline = time.Minute * 5
)
View Source
const (
	PluginStatus = "plugin.status"
)

Variables

View Source
var (
	Version  string = ""
	Revision string = ""

	PathIgnoreMap map[string]bool

	ObjectTypeStrMapping = map[string]int{
		QuestionObjectType:   1,
		AnswerObjectType:     2,
		TagObjectType:        3,
		UserObjectType:       4,
		CollectionObjectType: 6,
		CommentObjectType:    7,
		ReportObjectType:     8,
	}

	ObjectTypeNumberMapping = map[int]string{
		1: QuestionObjectType,
		2: AnswerObjectType,
		3: TagObjectType,
		4: UserObjectType,
		6: CollectionObjectType,
		7: CommentObjectType,
		8: ReportObjectType,
	}
)

ObjectTypeStrMapping key => value object TagID AnswerList key equal database's table name

View Source
var (
	DefaultAvatar  = "system"
	DefaultSiteURL = ""
)

Functions

func ExistInPathIgnore added in v1.0.0

func ExistInPathIgnore(name string) bool

Types

type ActivityTypeKey added in v0.5.0

type ActivityTypeKey string
const (
	ActQuestionAsked     ActivityTypeKey = "question.asked"
	ActQuestionClosed    ActivityTypeKey = "question.closed"
	ActQuestionReopened  ActivityTypeKey = "question.reopened"
	ActQuestionAnswered  ActivityTypeKey = "question.answered"
	ActQuestionCommented ActivityTypeKey = "question.commented"
	ActQuestionAccept    ActivityTypeKey = "question.accept"
	ActQuestionUpvote    ActivityTypeKey = "question.upvote"
	ActQuestionDownVote  ActivityTypeKey = "question.downvote"
	ActQuestionEdited    ActivityTypeKey = "question.edited"
	ActQuestionRollback  ActivityTypeKey = "question.rollback"
	ActQuestionDeleted   ActivityTypeKey = "question.deleted"
	ActQuestionUndeleted ActivityTypeKey = "question.undeleted"
	ActQuestionPin       ActivityTypeKey = "question.pin"
	ActQuestionUnPin     ActivityTypeKey = "question.unpin"
	ActQuestionHide      ActivityTypeKey = "question.hide"
	ActQuestionShow      ActivityTypeKey = "question.show"
)
const (
	ActAnswerAnswered  ActivityTypeKey = "answer.answered"
	ActAnswerCommented ActivityTypeKey = "answer.commented"
	ActAnswerAccept    ActivityTypeKey = "answer.accept"
	ActAnswerUpvote    ActivityTypeKey = "answer.upvote"
	ActAnswerDownVote  ActivityTypeKey = "answer.downvote"
	ActAnswerEdited    ActivityTypeKey = "answer.edited"
	ActAnswerRollback  ActivityTypeKey = "answer.rollback"
	ActAnswerDeleted   ActivityTypeKey = "answer.deleted"
	ActAnswerUndeleted ActivityTypeKey = "answer.undeleted"
)
const (
	ActTagCreated   ActivityTypeKey = "tag.created"
	ActTagEdited    ActivityTypeKey = "tag.edited"
	ActTagRollback  ActivityTypeKey = "tag.rollback"
	ActTagDeleted   ActivityTypeKey = "tag.deleted"
	ActTagUndeleted ActivityTypeKey = "tag.undeleted"
)

type Privilege added in v1.1.0

type Privilege struct {
	Key   string `json:"key"`
	Label string `json:"label"`
	Value int    `json:"value"`
}

Jump to

Keyboard shortcuts

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