schema

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TITLE_REGEX_N_GRAM              = 5
	TIME_CALC_ALL_USER_VISIT_COUNTS = -10 * time.Minute

	MAX_CONTENT_BLOCK = 5

	MAX_ALL_CONTENT_BLOCK = 2000

	STR_REPLY       = "Re:"
	STR_REPLY_LOWER = "re:"

	STR_FORWARD       = "Fw:"
	STR_FORWARD_LOWER = "fw:"

	STR_LEGACY_FORWARD = "[轉錄]"

	MAX_COMMENT_BYTES = 90
)
View Source
const (
	N_USER_FAVORITES_DOUBLE_BUFFER = 2
)

Variables

View Source
var (
	MONGO_HOST     = "localhost"
	MONGO_PORT     = 27017
	MONGO_DBNAME   = "devptt"
	MONGO_PROTOCOL = "mongodb"

	MAX_COMMENT_BLOCK         = 20
	MAX_COMMENT_SUMMARY_BLOCK = 50

	REDIS_HOST             = "localhost:6379"
	REDIS_TIMEOUT_MILLI_TS = time.Duration(10)
)
View Source
var (
	ACCESS_TOKEN_ACCESS_TOKEN_b   = getBSONName(EMPTY_ACCESS_TOKEN, "AccessToken")
	ACCESS_TOKEN_USER_ID_b        = getBSONName(EMPTY_ACCESS_TOKEN, "UserID")
	ACCESS_TOKEN_UPDATE_NANO_TS_b = getBSONName(EMPTY_ACCESS_TOKEN, "UpdateNanoTS")
)
View Source
var (
	ARTICLE_BBOARD_ID_b   = getBSONName(EMPTY_ARTICLE, "BBoardID")
	ARTICLE_ARTICLE_ID_b  = getBSONName(EMPTY_ARTICLE, "ArticleID")
	ARTICLE_IS_DELETED_b  = getBSONName(EMPTY_ARTICLE, "IsDeleted")
	ARTICLE_FILENAME_b    = getBSONName(EMPTY_ARTICLE, "Filename")
	ARTICLE_CREATE_TIME_b = getBSONName(EMPTY_ARTICLE, "CreateTime")
	ARTICLE_MTIME_b       = getBSONName(EMPTY_ARTICLE, "MTime")
	ARTICLE_RECOMMEND_b   = getBSONName(EMPTY_ARTICLE, "Recommend")
	ARTICLE_OWNER_b       = getBSONName(EMPTY_ARTICLE, "Owner")
	ARTICLE_FULL_TITLE_b  = getBSONName(EMPTY_ARTICLE, "FullTitle")
	ARTICLE_TITLE_b       = getBSONName(EMPTY_ARTICLE, "Title")
	ARTICLE_MONEY_b       = getBSONName(EMPTY_ARTICLE, "Money")
	ARTICLE_CLASS_b       = getBSONName(EMPTY_ARTICLE, "Class")
	ARTICLE_FILEMODE_b    = getBSONName(EMPTY_ARTICLE, "Filemode")
	ARTICLE_TITLE_REGEX_b = getBSONName(EMPTY_ARTICLE, "TitleRegex")

	ARTICLE_IDX_b = getBSONName(EMPTY_ARTICLE, "Idx")

	ARTICLE_UPDATE_NANO_TS_b = getBSONName(EMPTY_ARTICLE, "UpdateNanoTS")

	ARTICLE_CONTENT_MTIME_b  = getBSONName(EMPTY_ARTICLE, "ContentMTime")
	ARTICLE_CONTENT_MD5_B    = getBSONName(EMPTY_ARTICLE, "ContentMD5")
	ARTICLE_CONTENT_b        = getBSONName(EMPTY_ARTICLE, "Content")
	ARTICLE_CONTENT_PREFIX_b = getBSONName(EMPTY_ARTICLE, "ContentPrefix")

	ARTICLE_IP_b   = getBSONName(EMPTY_ARTICLE, "IP")
	ARTICLE_HOST_b = getBSONName(EMPTY_ARTICLE, "Host")
	ARTICLE_BBS_b  = getBSONName(EMPTY_ARTICLE, "BBS")

	ARTICLE_CONTENT_UPDATE_NANO_TS_b = getBSONName(EMPTY_ARTICLE, "ContentUpdateNanoTS")

	ARTICLE_SIGNATURE_DBCS_b = getBSONName(EMPTY_ARTICLE, "SignatureDBCS")
	ARTICLE_SIGNATURE_MD5_b  = getBSONName(EMPTY_ARTICLE, "SignatureMD5")

	ARTICLE_FIRST_COMMENTS_MD5_b       = getBSONName(EMPTY_ARTICLE, "FirstCommentsMD5")
	ARTICLE_FIRST_COMMENTS_LAST_TIME_b = getBSONName(EMPTY_ARTICLE, "FirstCommentsLastTime")

	ARTICLE_FIRST_COMMENTS_UPDATE_NANO_TS_b = getBSONName(EMPTY_ARTICLE, "FirstCommentsUpdateNanoTS")

	ARTICLE_N_COMMENTS_b              = getBSONName(EMPTY_ARTICLE, "NComments")
	ARTICLE_COMMENTS_UPDATE_NANO_TS_b = getBSONName(EMPTY_ARTICLE, "CommentsUpdateNanoTS")

	ARTICLE_RANK_b                   = getBSONName(EMPTY_ARTICLE, "Rank")
	ARTICLE_RANK_TO_UPDATE_NANO_TS_b = getBSONName(EMPTY_ARTICLE, "RankToUpdateNanoTS")
	ARTICLE_RANK_UPDATE_NANO_TS_b    = getBSONName(EMPTY_ARTICLE, "RankUpdateNanoTS")

	ARTICLE_SUBJECT_TYPE_b = getBSONName(EMPTY_ARTICLE, "SubjectType")

	ARTICLE_IS_BOTTOM_b = getBSONName(EMPTY_ARTICLE, "IsBottom")
)
View Source
var (
	BOARD_BBOARD_ID_b      = getBSONName(EMPTY_BOARD, "BBoardID")
	BOARD_BRDNAME_b        = getBSONName(EMPTY_BOARD, "Brdname")
	BOARD_TITLE_b          = getBSONName(EMPTY_BOARD, "Title")
	BOARD_BRD_ATTR_b       = getBSONName(EMPTY_BOARD, "BrdAttr")
	BOARD_BOARD_TYPE_b     = getBSONName(EMPTY_BOARD, "BoardType")
	BOARD_CATEGORY_b       = getBSONName(EMPTY_BOARD, "Category")
	BOARD_NUSER_b          = getBSONName(EMPTY_BOARD, "NUser")
	BOARD_BMS_b            = getBSONName(EMPTY_BOARD, "BMs")
	BOARD_TOTAL_b          = getBSONName(EMPTY_BOARD, "Total")
	BOARD_LAST_POST_TIME_b = getBSONName(EMPTY_BOARD, "LastPostTime")
	BOARD_UDPATE_TIME_b    = getBSONName(EMPTY_BOARD, "UpdateTime")

	BOARD_VOTE_LIMIT_LOGINS_b  = getBSONName(EMPTY_BOARD, "VoteLimitLogins")
	BOARD_POST_LIMIT_LOGINS_b  = getBSONName(EMPTY_BOARD, "PostLimitLogins")
	BOARD_VOTE_LIMIT_BADPOST_b = getBSONName(EMPTY_BOARD, "VoteLimitBadpost")
	BOARD_POST_LIMIT_BADPOST_b = getBSONName(EMPTY_BOARD, "PostLimitBadpost")

	BOARD_PARENT_b = getBSONName(EMPTY_BOARD, "Parent")

	BOARD_NVOTE_b             = getBSONName(EMPTY_BOARD, "NVote")
	BOARD_VOTE_CLOSING_TIME_b = getBSONName(EMPTY_BOARD, "VoteClosingTime")

	BOARD_LEVEL_b                = getBSONName(EMPTY_BOARD, "Level")
	BOARD_LAST_SET_TIME_b        = getBSONName(EMPTY_BOARD, "LastSetTime")
	BOARD_POST_EXPIRE_b          = getBSONName(EMPTY_BOARD, "PostExpire")
	BOARD_END_GAMBLE_NANO_TS_b   = getBSONName(EMPTY_BOARD, "EndGambleNanoTS")
	BOARD_POST_TYPE_b            = getBSONName(EMPTY_BOARD, "PostType")
	BOARD_POST_TEMPLATE_b        = getBSONName(EMPTY_BOARD, "PostTemplate")
	BOARD_FAST_RECOMMEND_PAUSE_b = getBSONName(EMPTY_BOARD, "FastRecommendPause")
	BOARD_IS_DELETED_b           = getBSONName(EMPTY_BOARD, "IsDeleted")
	BOARD_UPDATE_NANO_TS_b       = getBSONName(EMPTY_BOARD, "UpdateNanoTS")

	BOARD_GID_b          = getBSONName(EMPTY_BOARD, "Gid")
	BOARD_BID_b          = getBSONName(EMPTY_BOARD, "Bid")
	BOARD_IDX_BY_NAME_b  = getBSONName(EMPTY_BOARD, "IdxByName")
	BOARD_IDX_BY_CLASS_b = getBSONName(EMPTY_BOARD, "IdxByClass")

	BOARD_CHESS_COUNTRY_b = getBSONName(EMPTY_BOARD, "ChessCountry")
)
View Source
var (
	CLIENT_CLIENT_ID_b      = getBSONName(EMPTY_CLIENT, "ClientID")
	CLIENT_CLIENT_SECRET_b  = getBSONName(EMPTY_CLIENT, "ClientSecret")
	CLIENT_REMOTE_ADDR_b    = getBSONName(EMPTY_CLIENT, "RemoteAddr")
	CLIENT_UPDATE_NANO_TS_b = getBSONName(EMPTY_CLIENT, "UpdateNanoTS")
)
View Source
var (
	COMMENT_BBOARD_ID_b     = getBSONName(EMPTY_COMMENT, "BBoardID")
	COMMENT_ARTICLE_ID_b    = getBSONName(EMPTY_COMMENT, "ArticleID")
	COMMENT_COMMENT_ID_b    = getBSONName(EMPTY_COMMENT, "CommentID")
	COMMENT_THE_TYPE_b      = getBSONName(EMPTY_COMMENT, "TheType")
	COMMENT_REF_IDS_b       = getBSONName(EMPTY_COMMENT, "RefIDs")
	COMMENT_IS_DELETED_b    = getBSONName(EMPTY_COMMENT, "IsDeleted")
	COMMENT_DELETE_REASON_b = getBSONName(EMPTY_COMMENT, "DeleteReason")
	COMMENT_CREATE_TIME_b   = getBSONName(EMPTY_COMMENT, "CreateTime")
	COMMENT_OWNER_b         = getBSONName(EMPTY_COMMENT, "Owner")
	COMMENT_CONTENT_b       = getBSONName(EMPTY_COMMENT, "Content")
	COMMENT_IP_b            = getBSONName(EMPTY_COMMENT, "IP")
	COMMENT_HOST_b          = getBSONName(EMPTY_COMMENT, "Host")
	COMMENT_MD5_b           = getBSONName(EMPTY_COMMENT, "MD5")

	COMMENT_FIRST_CREATE_TIME_b    = getBSONName(EMPTY_COMMENT, "FirstCreateTime")
	COMMENT_INFERRED_CREATE_TIME_b = getBSONName(EMPTY_COMMENT, "InferredCreateTime")
	COMMENT_NEW_CREATE_TIME_b      = getBSONName(EMPTY_COMMENT, "NewCreateTime")

	COMMENT_SORT_TIME_b = getBSONName(EMPTY_COMMENT, "SortTime")

	COMMENT_THE_DATE_b = getBSONName(EMPTY_COMMENT, "TheDate")
	COMMENT_DBCS_b     = getBSONName(EMPTY_COMMENT, "DBCS")

	COMMENT_EDIT_NANO_TS_b = getBSONName(EMPTY_COMMENT, "EditNanoTS")

	COMMENT_UPDATE_NANO_TS_b = getBSONName(EMPTY_COMMENT, "UpdateNanoTS")
)
View Source
var (
	CONTENT_BLOCK_BBOARD_ID_b  = getBSONName(EMPTY_CONTENT_BLOCK, "BBoardID")
	CONTENT_BLOCK_ARTICLE_ID_b = getBSONName(EMPTY_CONTENT_BLOCK, "ArticleID")
	CONTENT_BLOCK_CONTENT_ID_b = getBSONName(EMPTY_CONTENT_BLOCK, "ContentID")
	CONTENT_BLOCK_IDX_b        = getBSONName(EMPTY_CONTENT_BLOCK, "Idx")
	CONTENT_BLOCK_IS_DELETED_b = getBSONName(EMPTY_CONTENT_BLOCK, "IsDeleted")

	CONTENT_BLOCK_CONTENT_b        = getBSONName(EMPTY_CONTENT_BLOCK, "Content")
	CONTENT_BLOCK_UPDATE_NANO_TS_b = getBSONName(EMPTY_CONTENT_BLOCK, "UpdateNanoTS")
)
View Source
var (
	ErrNoLock               = errors.New("no lock")
	ErrNoMatch              = errors.New("no match")
	ErrNoUpdate             = errors.New("no update")
	ErrNoCreate             = errors.New("no create")
	ErrInvalidUserFavorites = errors.New("invalid user favorites")
	Err2FAAlreadyExists     = errors.New("2fa already exists")
)
View Source
var (
	MAN_ARTICLE_BBOARD_ID_b   = getBSONName(EMPTY_MAN_ARTICLE, "BBoardID")
	MAN_ARTICLE_ARTICLE_ID_b  = getBSONName(EMPTY_MAN_ARTICLE, "ArticleID")
	MAN_ARTICLE_LEVEL_IDX_b   = getBSONName(EMPTY_MAN_ARTICLE, "LevelIdx")
	MAN_ARTICLE_IS_DELETED_b  = getBSONName(EMPTY_MAN_ARTICLE, "IsDeleted")
	MAN_ARTICLE_CREATE_TIME_b = getBSONName(EMPTY_MAN_ARTICLE, "CreateTime")
	MAN_ARTICLE_TITLE_b       = getBSONName(EMPTY_MAN_ARTICLE, "Title")
	MAN_ARTICLE_FILEMODE_b    = getBSONName(EMPTY_MAN_ARTICLE, "Filemode")
	MAN_ARTICLE_IS_DIR_b      = getBSONName(EMPTY_MAN_ARTICLE, "IsDir")

	MAN_ARTICLE_UPDATE_NANO_TS_b = getBSONName(EMPTY_MAN_ARTICLE, "UpdateNanoTS")
	MAN_ARTICLE_CONTENT_MTIME_b  = getBSONName(EMPTY_MAN_ARTICLE, "ContentMTime")
	MAN_ARTICLE_CONTENT_MD5_b    = getBSONName(EMPTY_MAN_ARTICLE, "ContentMD5")
	MAN_ARTICLE_CONTENT_b        = getBSONName(EMPTY_MAN_ARTICLE, "Content")
	MAN_ARTICLE_CONTENT_ID_b     = getBSONName(EMPTY_MAN_ARTICLE, "ContentID")

	MAN_ARTICLE_IP_b                     = getBSONName(EMPTY_MAN_ARTICLE, "IP")
	MAN_ARTICLE_HOST_b                   = getBSONName(EMPTY_MAN_ARTICLE, "Host")
	MAN_ARTICLE_BBS_b                    = getBSONName(EMPTY_MAN_ARTICLE, "BBS")
	MAN_ARTICLE_CONTENT_UPDATE_NANO_TS_b = getBSONName(EMPTY_MAN_ARTICLE, "ContentUpdateNanoTS")

	MAN_ARTICLE_IDX_b = getBSONName(EMPTY_MAN_ARTICLE, "Idx")
)
View Source
var (
	RANK_BBOARD_ID_b      = getBSONName(EMPTY_RANK, "BBoardID")
	RANK_ARTICLE_ID_b     = getBSONName(EMPTY_RANK, "ArticleID")
	RANK_OWNER_b          = getBSONName(EMPTY_RANK, "Owner")
	RANK_RANK_b           = getBSONName(EMPTY_RANK, "Rank")
	RANK_UPDATE_NANO_TS_b = getBSONName(EMPTY_RANK, "UpdateNanoTS")
)
View Source
var (
	USER_USER_ID_b  = getBSONName(EMPTY_USER, "UserID")
	USER_USERNAME_b = getBSONName(EMPTY_USER, "Username")
	USER_REALNAME_b = getBSONName(EMPTY_USER, "Realname")
	USER_NICKNAME_b = getBSONName(EMPTY_USER, "Nickname")

	USER_UFLAG_b           = getBSONName(EMPTY_USER, "Uflag")
	USER_USER_LEVEL_b      = getBSONName(EMPTY_USER, "Userlevel")
	USER_NUMLOGINDAYS_b    = getBSONName(EMPTY_USER, "Numlogindays")
	USER_NUMPOSTS_b        = getBSONName(EMPTY_USER, "Numposts")
	USER_FIRSTLOGIN_b      = getBSONName(EMPTY_USER, "Firstlogin")
	USER_LASTLOGIN_b       = getBSONName(EMPTY_USER, "Lastlogin")
	USER_LAST_IP_b         = getBSONName(EMPTY_USER, "LastIP")
	USER_LAST_HOST_b       = getBSONName(EMPTY_USER, "LastHost")
	USER_MONEY_b           = getBSONName(EMPTY_USER, "Money")
	USER_PTTEMAIL_b        = getBSONName(EMPTY_USER, "PttEmail")
	USER_JUSTIFY_b         = getBSONName(EMPTY_USER, "Justify")
	USER_OVER18_b          = getBSONName(EMPTY_USER, "Over18")
	USER_PAGER_UI_TYPE_b   = getBSONName(EMPTY_USER, "PagerUIType")
	USER_PAGER_b           = getBSONName(EMPTY_USER, "Pager")
	USER_INVISIBLE_b       = getBSONName(EMPTY_USER, "Invisible")
	USER_EXMAILBOX_b       = getBSONName(EMPTY_USER, "Exmailbox")
	USER_CAREER_b          = getBSONName(EMPTY_USER, "Career")
	USER_ROLE_b            = getBSONName(EMPTY_USER, "Role")
	USER_LAST_SEEN_b       = getBSONName(EMPTY_USER, "LastSeen")
	USER_TIME_SET_ANGEL_b  = getBSONName(EMPTY_USER, "TimeSetAngel")
	USER_TIME_PLAY_ANGEL_b = getBSONName(EMPTY_USER, "TimePlayAngel")
	USER_LAST_SONG_b       = getBSONName(EMPTY_USER, "LastSong")
	USER_LOGIN_VIEW_b      = getBSONName(EMPTY_USER, "LoginView")

	USER_VLCOUNT_b    = getBSONName(EMPTY_USER, "Vlcount")
	USER_FIVE_WIN_b   = getBSONName(EMPTY_USER, "FiveWin")
	USER_FIVE_LOSE_b  = getBSONName(EMPTY_USER, "FiveLose")
	USER_FIVE_TIE_b   = getBSONName(EMPTY_USER, "FiveTie")
	USER_CHC_WIN_b    = getBSONName(EMPTY_USER, "ChcWin")
	USER_CHC_LOSE_b   = getBSONName(EMPTY_USER, "ChcLose")
	USER_CHC_TIE_b    = getBSONName(EMPTY_USER, "ChcTie")
	USER_CONN6_WIN_b  = getBSONName(EMPTY_USER, "Conn6Win")
	USER_CONN6_LOSE_b = getBSONName(EMPTY_USER, "Conn6Lose")
	USER_CONN6_TIE_b  = getBSONName(EMPTY_USER, "Conn6Tie")
	USER_GO_WIN_b     = getBSONName(EMPTY_USER, "GoWin")
	USER_GO_LOSE_b    = getBSONName(EMPTY_USER, "GoLose")
	USER_GO_TIE_b     = getBSONName(EMPTY_USER, "GoTie")
	USER_DARK_WIN_b   = getBSONName(EMPTY_USER, "DarkWin")
	USER_DARK_LOSE_b  = getBSONName(EMPTY_USER, "DarkLose")
	USER_DARK_TIE_b   = getBSONName(EMPTY_USER, "DarkTie")
	USER_UA_VERSION_b = getBSONName(EMPTY_USER, "UaVersion")

	USER_SIGNATURE_b = getBSONName(EMPTY_USER, "Signature")
	USER_BAD_POST_b  = getBSONName(EMPTY_USER, "BadPost")
	USER_MY_ANGEL_b  = getBSONName(EMPTY_USER, "MyAngel")

	USER_CHESS_ELO_RATING_b = getBSONName(EMPTY_USER, "ChessEloRating")

	USER_TIME_REMOVE_BAD_POST_b = getBSONName(EMPTY_USER, "TimeRemoveBadPost")
	USER_TIME_VIOLATE_LAW_b     = getBSONName(EMPTY_USER, "TimeViolateLaw")

	USER_IS_DELETED_b     = getBSONName(EMPTY_USER, "IsDeleted")
	USER_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER, "UpdateNanoTS")

	USER_USER_LEVEL2_b     = getBSONName(EMPTY_USER, "UserLevel2")
	USER_UPDATE_NANO_TS2_b = getBSONName(EMPTY_USER, "UpdateNanoTS2")

	USER_AVATAR_b         = getBSONName(EMPTY_USER, "Avatar")
	USER_AVATAR_NANO_TS_b = getBSONName(EMPTY_USER, "AvatorNanoTS")

	USER_EMAIL_b         = getBSONName(EMPTY_USER, "Email")
	USER_EMAIL_NANO_TS_b = getBSONName(EMPTY_USER, "EmailNanoTS")

	USER_TWO_FACTOR_ENABLED_b         = getBSONName(EMPTY_USER, "TwoFactorEnabled")
	USER_TWO_FACTOR_ENABLED_NANO_TS_b = getBSONName(EMPTY_USER, "TwoFactorEnabledNanoTS")
)
View Source
var (
	USER_EMAIL_USER_ID_b        = getBSONName(EMPTY_USER_EMAIL, "UserID")
	USER_EMAIL_EMAIL_b          = getBSONName(EMPTY_USER_EMAIL, "Email")
	USER_EMAIL_IS_SET_b         = getBSONName(EMPTY_USER_EMAIL, "IsSet")
	USER_EMAIL_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_EMAIL, "UpdateNanoTS")
)
View Source
var (
	USER_FAVORITES_USER_ID_b           = getBSONName(EMPTY_USER_FAVORITES, "UserID")
	USER_FAVORITES_DOUBLE_BUFFER_IDX_b = getBSONName(EMPTY_USER_FAVORITES, "DoubleBufferIdx")
	USER_FAVORITES_FAV_IDX_b           = getBSONName(EMPTY_USER_FAVORITES, "FavIdx")
	USER_FAVORITES_LEVEL_IDX_b         = getBSONName(EMPTY_USER_FAVORITES, "LevelIdx")
	USER_FAVORITES_IDX_b               = getBSONName(EMPTY_USER_FAVORITES, "Idx")
	USER_FAVORITES_UPDATE_NANO_TS_b    = getBSONName(EMPTY_USER_FAVORITES, "UpdateNanoTS")
	USER_FAVORITES_MTIME_b             = getBSONName(EMPTY_USER_FAVORITES, "MTime")

	USER_FAVORITES_THE_TYPE_b     = getBSONName(EMPTY_USER_FAVORITES, "TheType")
	USER_FAVORITES_ATTR_b         = getBSONName(EMPTY_USER_FAVORITES, "Attr")
	USER_FAVORITES_THE_ID_b       = getBSONName(EMPTY_USER_FAVORITES, "TheID")
	USER_FAVORITES_FOLDER_TITLE_b = getBSONName(EMPTY_USER_FAVORITES, "FolderTitle")
)
View Source
var (
	USER_FAVORITES_META_USER_ID_b           = getBSONName(EMPTY_USER_FAVORITES_META, "UserID")
	USER_FAVORITES_META_DOUBLE_BUFFER_IDX_b = getBSONName(EMPTY_USER_FAVORITES_META, "DoubleBufferIdx")
	USER_FAVORITES_META_UPDATE_NANO_TS_b    = getBSONName(EMPTY_USER_FAVORITES_META, "UpdateNanoTS")
	USER_FAVORITES_META_MTIME_b             = getBSONName(EMPTY_USER_FAVORITES_META, "MTime")
	USER_FAVORITES_META_FAV_NUM_b           = getBSONName(EMPTY_USER_FAVORITES_META, "FavNum")
)
View Source
var (
	USER_FAVORITES_NANO_TS_USER_ID_b        = getBSONName(EMPTY_USER_FAVORITES_NANO_TS, "UserID")
	USER_FAVORITES_NANO_TS_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_FAVORITES_NANO_TS, "UpdateNanoTS")
)
View Source
var (
	USER_ID_EMAIL_USER_ID_b        = getBSONName(EMPTY_USER_ID_EMAIL, "UserID")
	USER_ID_EMAIL_ID_EMAIL_b       = getBSONName(EMPTY_USER_ID_EMAIL, "IDEmail")
	USER_ID_EMAIL_IS_SET_b         = getBSONName(EMPTY_USER_ID_EMAIL, "IsSet")
	USER_ID_EMAIL_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_ID_EMAIL, "UpdateNanoTS")
)
View Source
var (
	USER_READ_ARTICLE_USER_ID_b        = getBSONName(EMPTY_USER_READ_ARTICLE, "UserID")
	USER_READ_ARTICLE_BOARD_ID_b       = getBSONName(EMPTY_USER_READ_ARTICLE, "BoardID")
	USER_READ_ARTICLE_ARTICLE_ID_b     = getBSONName(EMPTY_USER_READ_ARTICLE, "ArticleID")
	USER_READ_ARTICLE_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_READ_ARTICLE, "UpdateNanoTS")
)
View Source
var (
	USER_READ_BOARD_USER_ID_b        = getBSONName(EMPTY_USER_READ_BOARD, "UserID")
	USER_READ_BOARD_BBOARD_ID_b      = getBSONName(EMPTY_USER_READ_BOARD, "BBoardID")
	USER_READ_BOARD_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_READ_BOARD, "UpdateNanoTS")
)
View Source
var (
	USER_VISIT_USER_ID_b        = getBSONName(EMPTY_USER_VISIT, "UserID")
	USER_VISIT_ACTION_b         = getBSONName(EMPTY_USER_VISIT, "Action")
	USER_VISIT_UPDATE_NANO_TS_b = getBSONName(EMPTY_USER_VISIT, "UpdateNanoTS")
)
View Source
var (
	REDIS_USER_VISIT_COUNT     = "user_visit_count"
	REDIS_USER_VISIT_COUNT_EXP = 10 * time.Minute
)
View Source
var AccessToken_c *db.Collection
View Source
var Article_c *db.Collection
View Source
var BoardBanuser_c *db.Collection
View Source
var BoardFriend_c *db.Collection
View Source
var Board_c *db.Collection
View Source
var Client_c *db.Collection
View Source
var Comment_c *db.Collection
View Source
var ContentBlock_c *db.Collection
View Source
var (
	DEFAULT_POST_TYPE = []string{"問題", "建議", "討論", "心得", "閒聊", "請益", "情報", "公告"}
)
View Source
var EMPTY_ACCESS_TOKEN = &AccessToken{}
View Source
var EMPTY_ARTICLE = &Article{}
View Source
var (
	EMPTY_ARTICLE_COMMENTS = &ArticleComments{}
)
View Source
var (
	EMPTY_ARTICLE_CONTENT_INFO = &ArticleContentInfo{}
)
View Source
var EMPTY_ARTICLE_CONTENT_MTIME = &ArticleContentMTime{}
View Source
var (
	EMPTY_ARTICLE_DETAIL_SUMMARY = &ArticleDetailSummary{}
)
View Source
var (
	EMPTY_ARTICLE_FIRST_COMMENTS = &ArticleFirstComments{}
)
View Source
var (
	EMPTY_ARTICLE_N_COMMENTS = &ArticleNComments{}
)
View Source
var EMPTY_ARTICLE_QUERY = &ArticleQuery{}
View Source
var (
	EMPTY_ARTICLE_SUMMARY = &ArticleSummary{}
)
View Source
var (
	EMPTY_ARTICLE_SUMMARY_WITH_REGEX = &ArticleSummaryWithRegex{}
)
View Source
var EMPTY_BOARD = &Board{}
View Source
var (
	EMPTY_BOARD_BID = &BoardBid{}
)
View Source
var (
	EMPTY_BOARD_DETAIL = &BoardDetail{}
)
View Source
var (
	EMPTY_BOARD_ID = &BoardID{}
)
View Source
var EMPTY_BOARD_QUERY = &BoardQuery{}
View Source
var (
	EMPTY_BOARD_SUMMARY = &BoardSummary{}
)
View Source
var EMPTY_CLIENT = &Client{}
View Source
var EMPTY_COMMENT = &Comment{}
View Source
var EMPTY_COMMENT_ARTICLE_QUERY = &CommentArticleQuery{}
View Source
var (
	EMPTY_COMMENT_DBCS = &CommentDBCS{}
)
View Source
var (
	EMPTY_COMMENT_IS_DELETED = &CommentIsDeleted{}
)
View Source
var (
	EMPTY_COMMENT_MD5 = &CommentMD5{}
)
View Source
var EMPTY_COMMENT_QUERY = &CommentQuery{}
View Source
var (
	EMPTY_COMMENT_SORT_TIME = &CommentSortTime{}
)
View Source
var (
	EMPTY_COMMENT_SUMMARY = &CommentSummary{}
)
View Source
var EMPTY_CONTENT_BLOCK = &ContentBlock{}
View Source
var EMPTY_CONTENT_BLOCK_QUERY = &ContentBlockQuery{}
View Source
var EMPTY_MAN_ARTICLE = &ManArticle{}
View Source
var (
	EMPTY_MAN_ARTICLE_CONTENT_INFO = &ManArticleContentInfo{}
)
View Source
var EMPTY_MAN_ARTICLE_CONTENT_MTIME = &ManArticleContentMTime{}
View Source
var (
	EMPTY_MAN_ARTICLE_DETAIL_SUMMARY = &ManArticleDetailSummary{}
)
View Source
var EMPTY_MAN_ARTICLE_QUERY = &ManArticleQuery{}
View Source
var (
	EMPTY_MAN_ARTICLE_SUMMARY = &ManArticleSummary{}
)
View Source
var EMPTY_RANK = &Rank{}
View Source
var EMPTY_USER = &User{}
View Source
var (
	EMPTY_USER_DETAIL = &UserDetail{}
)
View Source
var EMPTY_USER_EMAIL = &UserEmail{}
View Source
var EMPTY_USER_FAVORITES = &UserFavorites{}
View Source
var EMPTY_USER_FAVORITES_META = &UserFavoritesMeta{}
View Source
var (
	EMPTY_USER_FAVORITES_META_SUMMARY = &UserFavoritesMetaSummary{}
)
View Source
var EMPTY_USER_FAVORITES_NANO_TS = &UserFavoritesNanoTS{}
View Source
var EMPTY_USER_FAVORITES_QUERY = &UserFavoritesQuery{}
View Source
var EMPTY_USER_FAVORITE_ID = &UserFavoriteID{}
View Source
var EMPTY_USER_ID_EMAIL = &UserIDEmail{}
View Source
var (
	EMPTY_USER_INFO_SUMMARY = &UserInfoSummary{}
)
View Source
var (
	EMPTY_USER_NEW_INFO = &UserNewInfo{}
)
View Source
var (
	EMPTY_USER_NICKNAME = &UserNickname{}
)
View Source
var EMPTY_USER_QUERY = &UserQuery{}
View Source
var EMPTY_USER_READ_ARTICLE = &UserReadArticle{}
View Source
var EMPTY_USER_READ_ARTICLE_QUERY = &UserReadArticleQuery{}
View Source
var EMPTY_USER_READ_BOARD = &UserReadBoard{}
View Source
var EMPTY_USER_READ_BOARD_QUERY = &UserReadBoardQuery{}
View Source
var EMPTY_USER_VISIT = &UserVisit{}
View Source
var (
	IsTest = false
)
View Source
var ManArticle_c *db.Collection
View Source
var ManContentBlock_c *db.Collection
View Source
var Rank_c *db.Collection
View Source
var UserAloha_c *db.Collection
View Source
var UserEmail_c *db.Collection
View Source
var UserFavoritesMeta_c *db.Collection
View Source
var UserFavoritesNanoTS_c *db.Collection
View Source
var UserFavorites_c *db.Collection
View Source
var UserFriend_c *db.Collection
View Source
var UserIDEmail_c *db.Collection
View Source
var UserReadArticle_c *db.Collection
View Source
var UserReadBoard_c *db.Collection
View Source
var UserReject_c *db.Collection
View Source
var UserVisit_c *db.Collection
View Source
var User_c *db.Collection

Functions

func CalculateAllUserVisitCounts added in v0.24.0

func CalculateAllUserVisitCounts() (int64, error)

CalculateAllUserVisitCounts count recent 10 mins users who are calling login_required_api

func Close added in v0.1.0

func Close() (err error)

Close

XXX do not really close to avoid db connection-error in tests.

func CountComments added in v0.9.8

func CountComments(boardID bbs.BBoardID, articleID bbs.ArticleID) (nComments int, err error)

func CreateUserEmail added in v0.8.3

func CreateUserEmail(userID bbs.UUserID, email string, updateNanoTS types.NanoTS) (err error)

func CreateUserIDEmail added in v0.8.0

func CreateUserIDEmail(userID bbs.UUserID, email string, updateNanoTS types.NanoTS) (err error)

func DeleteArticles added in v0.23.0

func DeleteArticles(boardID bbs.BBoardID, articleIDs []bbs.ArticleID, updateNanoTS types.NanoTS) (err error)

DeleteArticles deletes articles in Database

func DeleteCommentsByArticles added in v0.23.0

func DeleteCommentsByArticles(boardID bbs.BBoardID, articleIDs []bbs.ArticleID, updateNanoTS types.NanoTS) (err error)

DeleteCommentsByArticles deletes all comments in deleted articles

func DeleteRanks added in v0.23.0

func DeleteRanks(boardID bbs.BBoardID, articleIDs []bbs.ArticleID, updateNanoTS types.NanoTS) (err error)

DeleteRanks deletes ranks in Database

func DeleteUserReadArticles added in v0.23.0

func DeleteUserReadArticles(boardID bbs.BBoardID, articleIDs []bbs.ArticleID, updateNanoTS types.NanoTS) (err error)

DeleteUserReadArticles deletes user_read_articles in Database

func FavToUserFavorites added in v0.9.0

func FavToUserFavorites(f *fav.Fav, userID bbs.UUserID, doubleBufferIdx int, updateNanoTS types.NanoTS, mTime types.NanoTS) (meta *UserFavoritesMeta, userFavorites []*UserFavorites)

func Get2FA added in v0.9.3

func Get2FA(userID bbs.UUserID) (emailtoken string, err error)

func GetBoardID added in v0.17.0

func GetBoardID(brdname string) (boardID bbs.BBoardID, err error)

func GetBoardIDByBid added in v0.21.0

func GetBoardIDByBid(bid ptttype.Bid) (boardID bbs.BBoardID, err error)

func GetCommentMapByCommentIDs added in v0.22.0

func GetCommentMapByCommentIDs(boardID bbs.BBoardID, articleID bbs.ArticleID, commentIDs []types.CommentID) (commentMap map[types.CommentID]*Comment, err error)

func GetCommentSortTimeMapByCommentIDs added in v0.22.0

func GetCommentSortTimeMapByCommentIDs(boardID bbs.BBoardID, articleID bbs.ArticleID, commentIDs []types.CommentID) (sortTimeMap map[types.CommentID]types.NanoTS, err error)

func GetUserNickname added in v0.22.1

func GetUserNickname(userID bbs.UUserID) (nickname string, err error)

func GetUserVisitCount added in v0.24.0

func GetUserVisitCount() (total int64)

func Init added in v0.1.0

func Init() (err error)

func InitConfig added in v0.1.0

func InitConfig() error

func RecoverCommentIDs added in v0.4.0

func RecoverCommentIDs(commentQueries []*CommentQuery) (err error)

RecoverCommentIDs

We need to use $unset to remove IS_DELETED IS_DELETED should never be false. (we use omitempty to avoid this issue.)

func RemoveCommentIDs added in v0.4.0

func RemoveCommentIDs(bboardID bbs.BBoardID, articleID bbs.ArticleID, toRemoveCommentIDs []types.CommentID, updateNanoTS types.NanoTS, reason string) (err error)

RemoveCommentIDs

Assuming that the data already exists, no need to check that update-nano-ts does not exists.

func RemoveManArticleSummaries added in v0.28.0

func RemoveManArticleSummaries(boardID bbs.BBoardID, levelIdx types.ManArticleID, idx int) (err error)

func ResetArticleIsBottom added in v0.26.0

func ResetArticleIsBottom(boardID bbs.BBoardID) (err error)

func Set2FA added in v0.9.3

func Set2FA(userID bbs.UUserID, email string, token string, expireTSDuration time.Duration) (err error)

func SetIsTest added in v0.4.0

func SetIsTest()

func SetUserVisitCount added in v0.24.0

func SetUserVisitCount(count int64) error

SetUserVisitCount try to set user visit count to redis

func SumRank added in v0.14.0

func SumRank(boardID bbs.BBoardID, articleID bbs.ArticleID) (total int, err error)

func TryLock added in v0.4.0

func TryLock(key string, expireTSDuration time.Duration) (err error)

TryLock

func TwoFactorSerializeValue added in v0.9.5

func TwoFactorSerializeValue(email string, token string) string

func Unlock added in v0.4.0

func Unlock(key string) (err error)

Unlock

func UnsetIsTest added in v0.4.0

func UnsetIsTest()

func UpdateAccessToken added in v0.4.0

func UpdateAccessToken(accessToken *AccessToken) (err error)

func UpdateArticleComments added in v0.4.0

func UpdateArticleComments(articleComments *ArticleComments) (err error)

UpdateArticleComments

We've already have article-content-info, we don't do create UpdateArticleComments

func UpdateArticleCommentsByArticleID added in v0.9.9

func UpdateArticleCommentsByArticleID(boardID bbs.BBoardID, articleID bbs.ArticleID, updateNanoTS types.NanoTS) (err error)

func UpdateArticleContentInfo added in v0.4.0

func UpdateArticleContentInfo(bboardID bbs.BBoardID, articleID bbs.ArticleID, contentInfo *ArticleContentInfo) (err error)

func UpdateArticleContentMTime added in v0.4.0

func UpdateArticleContentMTime(bboardID bbs.BBoardID, articleID bbs.ArticleID, contentMTime types.NanoTS) (err error)

func UpdateArticleEditSummary added in v0.22.0

func UpdateArticleEditSummary(boardID bbs.BBoardID, articleID bbs.ArticleID, articleEditSummary *ArticleEditSummary, updateNanoTS types.NanoTS) (err error)

func UpdateArticleFirstComments added in v0.4.0

func UpdateArticleFirstComments(articleFirstComments *ArticleFirstComments) (err error)

func UpdateArticleRank added in v0.14.0

func UpdateArticleRank(boardID bbs.BBoardID, articleID bbs.ArticleID, diffRank int, updateNanoTS types.NanoTS) (newRank int, err error)

func UpdateArticleSummaries added in v0.4.0

func UpdateArticleSummaries(articleSummaries []*ArticleSummary, updateNanoTS types.NanoTS) (err error)

func UpdateArticleSummaryWithRegexes added in v0.19.4

func UpdateArticleSummaryWithRegexes(articleSummaryWithRegexes []*ArticleSummaryWithRegex, updateNanoTS types.NanoTS) (err error)

func UpdateBoardDetails added in v0.29.0

func UpdateBoardDetails(boardDetails []*BoardDetail, updateNanoTS types.NanoTS) (err error)

func UpdateBoardSummaries added in v0.4.0

func UpdateBoardSummaries(boardSummaries []*BoardSummary, updateNanoTS types.NanoTS) (err error)

func UpdateClient added in v0.4.0

func UpdateClient(c *Client) (err error)

func UpdateCommentSummaries added in v0.4.0

func UpdateCommentSummaries(bboardID bbs.BBoardID, articleID bbs.ArticleID, commentSummaries []*CommentSummary, updateNanoTS types.NanoTS) (err error)

func UpdateComments added in v0.4.0

func UpdateComments(comments []*Comment, updateNanoTS types.NanoTS) (err error)

UpdateComments

XXX hack in updateCommentsCore:

treat all the comments as non-deleted and unset IsDeleted.

func UpdateContentBlocks added in v0.24.0

func UpdateContentBlocks(contentBlocks []*ContentBlock, updateNanoTS types.NanoTS) (err error)

func UpdateManArticleContentInfo added in v0.28.0

func UpdateManArticleContentInfo(bboardID bbs.BBoardID, articleID types.ManArticleID, contentInfo *ManArticleContentInfo) (err error)

func UpdateManArticleContentMTime added in v0.28.0

func UpdateManArticleContentMTime(bboardID bbs.BBoardID, articleID types.ManArticleID, contentMTime types.NanoTS) (err error)

func UpdateManArticleSummaries added in v0.28.0

func UpdateManArticleSummaries(articleSummaries []*ManArticleSummary, updateNanoTS types.NanoTS) (err error)

func UpdateManContentBlocks added in v0.28.0

func UpdateManContentBlocks(contentBlocks []*ContentBlock, updateNanoTS types.NanoTS) (err error)

func UpdateRank added in v0.14.0

func UpdateRank(boardID bbs.BBoardID, articleID bbs.ArticleID, ownerID bbs.UUserID, rank int, updateNanoTS types.NanoTS) (origRank int, err error)

func UpdateUserDetail added in v0.6.0

func UpdateUserDetail(user *UserDetail) (err error)

func UpdateUserEmailIsSet added in v0.8.3

func UpdateUserEmailIsSet(userID bbs.UUserID, email string, isSet bool, updateNanoTS types.NanoTS) (err error)

func UpdateUserFavorites added in v0.9.0

func UpdateUserFavorites(userID bbs.UUserID, doubleBufferIdx int, userFavorites []*UserFavorites, mTime types.NanoTS, updateNanoTS types.NanoTS) (err error)

func UpdateUserFavoritesMeta added in v0.9.0

func UpdateUserFavoritesMeta(meta *UserFavoritesMeta) (err error)

func UpdateUserIDEmailIsSet added in v0.8.0

func UpdateUserIDEmailIsSet(userID bbs.UUserID, email string, isSet bool, updateNanoTS types.NanoTS) (err error)

func UpdateUserReadArticle added in v0.4.0

func UpdateUserReadArticle(userReadArticle *UserReadArticle) (err error)

func UpdateUserReadArticles added in v0.4.0

func UpdateUserReadArticles(userReadArticles []*UserReadArticle, updateNanoTS types.NanoTS) (err error)

func UpdateUserReadBoard added in v0.4.0

func UpdateUserReadBoard(userReadBoard *UserReadBoard) (err error)

func UpdateUserReadBoards added in v0.4.0

func UpdateUserReadBoards(userReadBoards []*UserReadBoard, updateNanoTS types.NanoTS) (err error)

func UpdateUserVisit added in v0.24.0

func UpdateUserVisit(userVisit *UserVisit) (err error)

UpdateUserVisit updates user_visit's document data

func UserFavoritesToFav added in v0.9.0

func UserFavoritesToFav(meta *FolderMeta, userFavorites []*UserFavorites, depth int) (f *fav.Fav, err error)

Types

type AccessToken

type AccessToken struct {
	AccessToken  string       `bson:"access_token"`
	UserID       bbs.UUserID  `bson:"user_id"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func NewAccessToken added in v0.4.0

func NewAccessToken(userID bbs.UUserID, jwt string, nowNanoTS types.NanoTS) *AccessToken

type Article added in v0.3.2

type Article struct {
	Version    int              `bson:"version"`
	BBoardID   bbs.BBoardID     `bson:"bid"`                 //
	ArticleID  bbs.ArticleID    `bson:"aid"`                 //
	IsDeleted  bool             `bson:"deleted,omitempty"`   //
	Filename   string           `bson:"filename"`            //
	CreateTime types.NanoTS     `bson:"create_time_nano_ts"` //
	MTime      types.NanoTS     `bson:"mtime_nano_ts"`       //
	Recommend  int              `bson:"recommend"`           //
	Owner      bbs.UUserID      `bson:"owner"`               //
	FullTitle  string           `bson:"full_title"`
	Title      string           `bson:"title"` //
	Money      int              `bson:"money"` //
	Class      string           `bson:"class"` //
	Filemode   ptttype.FileMode `bson:"mode"`  //

	TitleRegex []string `bson:"title_regex"`

	Idx string `bson:"pttidx"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"` // used by article-summary

	ContentMTime  types.NanoTS    `bson:"content_mtime_nano_ts"` //
	ContentMD5    string          `bson:"content_md5"`
	ContentID     types.ContentID `bson:"content_id"`
	Content       [][]*types.Rune `bson:"content"`        //
	ContentPrefix [][]*types.Rune `bson:"content_prefix"` //

	IP                  string       `bson:"ip"`   //
	Host                string       `bson:"host"` // ip 的中文呈現, 外國則為國家.
	BBS                 string       `bson:"bbs"`  //
	ContentUpdateNanoTS types.NanoTS `bson:"content_update_nano_ts"`

	SignatureDBCS []byte `bson:"signature_dbcs"`
	SignatureMD5  string `bson:"signature_md5"`

	FirstCommentsMD5          string       `bson:"first_comments_md5"`
	FirstCommentsLastTime     types.NanoTS `bson:"first_comments_last_time_nano_ts"`
	FirstCommentsUpdateNanoTS types.NanoTS `bson:"first_comments_update_nano_ts"`

	NComments            int          `bson:"n_comments"`
	CommentsUpdateNanoTS types.NanoTS `bson:"comments_update_nano_ts"`

	Rank               int          `bson:"rank"` // 評價
	RankToUpdateNanoTS types.NanoTS `bson:"rank_to_update_nano_ts"`
	RankUpdateNanoTS   types.NanoTS `bson:"rank_update_nano_ts"`

	SubjectType ptttype.SubjectType `bson:"subject_type"`

	IsBottom bool `bson:"is_bottom"`
}

type ArticleComments added in v0.4.0

type ArticleComments struct {
	BBoardID  bbs.BBoardID  `bson:"bid"` //
	ArticleID bbs.ArticleID `bson:"aid"` //

	NComments int `bson:"n_comments"`

	CommentsUpdateNanoTS types.NanoTS `bson:"comments_update_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"` //

}

type ArticleContentInfo added in v0.4.0

type ArticleContentInfo struct {
	ContentMD5 string `bson:"content_md5"`

	ContentID           types.ContentID `bson:"content_id"`
	Content             [][]*types.Rune `bson:"content"`
	ContentPrefix       [][]*types.Rune `bson:"content_prefix"` //
	IP                  string          `bson:"ip"`
	Host                string          `bson:"host"` // ip 的中文呈現, 外國則為國家.
	BBS                 string          `bson:"bbs"`
	ContentUpdateNanoTS types.NanoTS    `bson:"content_update_nano_ts"`

	SignatureDBCS []byte `bson:"signature_dbcs"`
	SignatureMD5  string `bson:"signature_md5"`

	IsDeleted bool `bson:"deleted,omitempty"` //
}

ContentInfo

func GetArticleContentInfo added in v0.4.0

func GetArticleContentInfo(bboardID bbs.BBoardID, articleID bbs.ArticleID, isContent bool) (contentInfo *ArticleContentInfo, err error)

type ArticleContentMTime added in v0.4.0

type ArticleContentMTime struct {
	ContentMTime types.NanoTS `bson:"content_mtime_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"` //
}

ContentMTime

func GetArticleContentMTime added in v0.4.0

func GetArticleContentMTime(bboardID bbs.BBoardID, articleID bbs.ArticleID) (ret *ArticleContentMTime, err error)

type ArticleDetailSummary added in v0.4.0

type ArticleDetailSummary struct {
	BBoardID   bbs.BBoardID  `bson:"bid"`
	ArticleID  bbs.ArticleID `bson:"aid"`
	IsDeleted  bool          `bson:"deleted,omitempty"`
	CreateTime types.NanoTS  `bson:"create_time_nano_ts"`
	MTime      types.NanoTS  `bson:"mtime_nano_ts"`

	Recommend int              `bson:"recommend"`
	Owner     bbs.UUserID      `bson:"owner"`
	Title     string           `bson:"title"`
	Money     int              `bson:"money"`
	Class     string           `bson:"class"`
	Filemode  ptttype.FileMode `bson:"mode"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	ContentMTime        types.NanoTS    `bson:"content_mtime_nano_ts"`
	ContentMD5          string          `bson:"content_md5"`
	ContentID           types.ContentID `bson:"content_id"`
	ContentUpdateNanoTS types.NanoTS    `bson:"content_update_nano_ts"`

	FirstCommentsMD5          string       `bson:"first_comments_md5"`
	FirstCommentsLastTime     types.NanoTS `bson:"first_comments_last_time_nano_ts"`
	FirstCommentsUpdateNanoTS types.NanoTS `bson:"first_comments_update_nano_ts"`

	NComments            int          `bson:"n_comments"`
	CommentsUpdateNanoTS types.NanoTS `bson:"comments_update_nano_ts"`

	IP   string `bson:"ip"`   //
	Host string `bson:"host"` // ip 的中文呈現, 外國則為國家.
	BBS  string `bson:"bbs"`  //

	Rank             int          `bson:"rank"` // 評價
	RankUpdateNanoTS types.NanoTS `bson:"rank_update_nano_ts"`

	Idx string `bson:"pttidx"`
}

ArticleDetailSummary

func GetArticleDetailSummaries added in v0.26.0

func GetArticleDetailSummaries(boardID bbs.BBoardID, startIdx string, descending bool, limit int, withDeleted bool) (result []*ArticleDetailSummary, err error)

func GetArticleDetailSummary added in v0.4.0

func GetArticleDetailSummary(bboardID bbs.BBoardID, articleID bbs.ArticleID) (result *ArticleDetailSummary, err error)

type ArticleEditSummary added in v0.22.0

type ArticleEditSummary struct {
	MTime      types.NanoTS `bson:"mtime_nano_ts"`
	FullTitle  string       `bson:"full_title"`
	Title      string       `bson:"title"`
	TitleRegex []string     `bson:"title_regex"`
	Class      string       `bson:"class"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func NewArticleEditSummary added in v0.22.0

func NewArticleEditSummary(mTime types.NanoTS, titleRaw []byte, fullTitleRaw []byte, theClassRaw []byte, updateNanoTS types.NanoTS) *ArticleEditSummary

type ArticleFirstComments added in v0.4.0

type ArticleFirstComments struct {
	BBoardID  bbs.BBoardID  `bson:"bid"` //
	ArticleID bbs.ArticleID `bson:"aid"` //

	FirstCommentsMD5          string       `bson:"first_comments_md5"`
	FirstCommentsLastTime     types.NanoTS `bson:"first_comments_last_time_nano_ts"`
	FirstCommentsUpdateNanoTS types.NanoTS `bson:"first_comments_update_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"` //
}

type ArticleIsDeleted added in v0.23.0

type ArticleIsDeleted struct {
	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type ArticleNComments added in v0.9.10

type ArticleNComments struct {
	// ArticleSummary
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`

	NComments int `bson:"n_comments,omitempty"` // n_comments is read-only in article-summary.

	Rank int `bson:"rank,omitempty"` // 評價
}

func GetArticleNCommentsByArticleIDs added in v0.9.10

func GetArticleNCommentsByArticleIDs(bboardID bbs.BBoardID, articleIDs []bbs.ArticleID) (articleNComments []*ArticleNComments, err error)

GetArticleNCommentsByArticleIDs

type ArticleQuery added in v0.4.0

type ArticleQuery struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`
	IsDeleted interface{}   `bson:"deleted,omitempty"` //
}

type ArticleRank added in v0.14.0

type ArticleRank struct {
	BBoardID  bbs.BBoardID  `bson:"bid"` //
	ArticleID bbs.ArticleID `bson:"aid"` //

	Rank               int          `bson:"rank"` // 評價
	RankToUpdateNanoTS types.NanoTS `bson:"rank_to_update_nano_ts"`
	RankUpdateNanoTS   types.NanoTS `bson:"rank_update_nano_ts"`
}

type ArticleSummary added in v0.4.0

type ArticleSummary struct {
	// ArticleSummary
	BBoardID   bbs.BBoardID  `bson:"bid"`
	ArticleID  bbs.ArticleID `bson:"aid"`
	IsDeleted  bool          `bson:"deleted,omitempty"`
	CreateTime types.NanoTS  `bson:"create_time_nano_ts"`
	MTime      types.NanoTS  `bson:"mtime_nano_ts"`

	Recommend int              `bson:"recommend"`
	Owner     bbs.UUserID      `bson:"owner"`
	FullTitle string           `bson:"full_title"`
	Title     string           `bson:"title"`
	Money     int              `bson:"money"`
	Class     string           `bson:"class"`
	Filemode  ptttype.FileMode `bson:"mode"`

	Idx string `bson:"pttidx"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	NComments int `bson:"n_comments,omitempty"` // n_comments is read-only in article-summary.

	Rank int `bson:"rank,omitempty"` // 評價, read-only

	SubjectType ptttype.SubjectType `bson:"subject_type"`

	IsBottom bool `bson:"is_bottom"`
}

ArticleSummary

func GetArticleSummaries added in v0.26.0

func GetArticleSummaries(boardID bbs.BBoardID, startIdx string, descending bool, limit int) (result []*ArticleSummary, err error)

func GetArticleSummariesByArticleIDs added in v0.19.0

func GetArticleSummariesByArticleIDs(articleIDs []bbs.ArticleID) (result []*ArticleSummary, err error)

func GetArticleSummariesByOwnerID added in v0.19.0

func GetArticleSummariesByOwnerID(ownerID bbs.UUserID, startCreateTime types.NanoTS, descending bool, limit int) (result []*ArticleSummary, err error)

func GetArticleSummariesByRegex added in v0.19.4

func GetArticleSummariesByRegex(boardID bbs.BBoardID, keywordList []string, createNanoTS types.NanoTS, articleID bbs.ArticleID, descending bool, limit int) (result []*ArticleSummary, err error)

func GetArticleSummary added in v0.4.0

func GetArticleSummary(bboardID bbs.BBoardID, articleID bbs.ArticleID) (result *ArticleSummary, err error)

func GetBottomArticleSummaries added in v0.26.0

func GetBottomArticleSummaries(boardID bbs.BBoardID) (result []*ArticleSummary, err error)

func NewArticleSummary added in v0.4.0

func NewArticleSummary(a_b *bbs.ArticleSummary, updateNanoTS types.NanoTS) *ArticleSummary

NewARticleSummary

no n_comments in bbs.ArticleSummary from backend.

type ArticleSummaryWithRegex added in v0.19.4

type ArticleSummaryWithRegex struct {
	// ArticleSummary
	BBoardID   bbs.BBoardID  `bson:"bid"`
	ArticleID  bbs.ArticleID `bson:"aid"`
	IsDeleted  bool          `bson:"deleted,omitempty"`
	CreateTime types.NanoTS  `bson:"create_time_nano_ts"`
	MTime      types.NanoTS  `bson:"mtime_nano_ts"`

	Recommend int              `bson:"recommend"`
	Owner     bbs.UUserID      `bson:"owner"`
	FullTitle string           `bson:"full_title"`
	Title     string           `bson:"title"`
	Money     int              `bson:"money"`
	Class     string           `bson:"class"`
	Filemode  ptttype.FileMode `bson:"mode"`

	TitleRegex []string `bson:"title_regex"`

	Idx string `bson:"pttidx"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	NComments int `bson:"n_comments,omitempty"` // n_comments is read-only in article-summary.

	Rank int `bson:"rank,omitempty"` // 評價, read-only

	SubjectType ptttype.SubjectType `bson:"subject_type"`

	IsBottom bool `bson:"is_bottom"`
}

ArticleSummaryWithRegex

func GetArticleSummaryWithRegex added in v0.19.4

func GetArticleSummaryWithRegex(bboardID bbs.BBoardID, articleID bbs.ArticleID) (result *ArticleSummaryWithRegex, err error)

func NewArticleSummaryWithRegex added in v0.19.4

func NewArticleSummaryWithRegex(a_b *bbs.ArticleSummary, updateNanoTS types.NanoTS) *ArticleSummaryWithRegex

NewArticleSummaryWithRegex

no n_comments in bbs.ArticleSummary from backend.

func NewArticleSummaryWithRegexFromPBArticle added in v0.26.0

func NewArticleSummaryWithRegexFromPBArticle(boardID bbs.BBoardID, a_b *boardd.Post, updateNanoTS types.NanoTS, isBottom bool) *ArticleSummaryWithRegex

NewArticleSummaryWithRegexFromPBArticle

no n_comments in bbs.ArticleSummary from backend.

type Board added in v0.3.2

type Board struct {
	Version   int             `bson:"version"`
	BBoardID  bbs.BBoardID    `bson:"bid"`
	Brdname   string          `bson:"brdname"`
	Title     string          `bson:"title"`
	BrdAttr   ptttype.BrdAttr `bson:"flag"`
	BoardType string          `bson:"the_type"`
	Category  string          `bson:"class"`
	NUser     int             `bson:"nuser"` /* use aggregate to periodically get the data */
	BMs       []bbs.UUserID   `bson:"bms"`
	Total     int             `bson:"total"` /* total articles, 需要即時知道. 因為 read 頻率高. 並且跟 last-post-time-ts 一樣 write 頻率 << read 頻率 */

	LastPostTime types.NanoTS `bson:"last_post_time_nano_ts"` /* 需要即時知道來做板的已讀 */

	UpdateTime types.NanoTS `bson:"update_time_nano_ts"` /* show 進板畫面, 目前只有 INT_MAX - 1 或 0 */

	VoteLimitLogins  int `bson:"vote_limit_logins"`
	PostLimitLogins  int `bson:"post_limit_logins"`
	VoteLimitBadpost int `bson:"vote_limit_bad_post"`
	PostLimitBadpost int `bson:"post_limit_bad_post"`

	Parent bbs.BBoardID `bson:"parent"`

	NVote           int          `bson:"vote"` /* use db-count to get current #vote */
	VoteClosingTime types.NanoTS `bson:"vtime_nano_ts"`

	Level              ptttype.PERM `bson:"perm"`
	LastSetTime        types.NanoTS `bson:"last_set_time_nano_ts"` /* perm-reload */
	PostExpire         ptttype.Bid  `bson:"post_expire"`           /* 看板連結的 bid */
	PostType           []string     `bson:"post_type"`
	PostTemplate       []bool       `bson:"post_tmpl"`
	EndGambleNanoTS    types.NanoTS `bson:"end_gamble_nano_ts"`
	FastRecommendPause types.NanoTS `bson:"fast_recommend_pause_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	Gid        ptttype.Bid `bson:"pttgid"`
	Bid        ptttype.Bid `bson:"pttbid"`
	IdxByName  string      `bson:"pttidxname"`
	IdxByClass string      `bson:"pttidxclass"`

	ChessCountry ptttype.ChessCode `bson:"chesscountry"`
}

type BoardBanUser added in v0.3.2

type BoardBanUser struct {
	BoardID   bbs.BBoardID `bson:"bid"`
	UserID    bbs.UUserID  `bson:"user_id"`
	EndNanoTS types.NanoTS `bson:"end_nano_ts"`
	PosterID  bbs.UUserID  `bson:"poster_id"`
	Reason    string       `bson:"reason"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type BoardBid added in v0.21.0

type BoardBid struct {
	Bid ptttype.Bid `bson:"pttbid"`

	IdxByName  string `bson:"pttidxname"`
	IdxByClass string `bson:"pttidxclass"`
}

func GetBoardBidsByClsID added in v0.21.0

func GetBoardBidsByClsID(clsID ptttype.Bid, startIdx string, isAsc bool, limit int, sortBy ptttype.BSortBy) (boardBids []*BoardBid, err error)

type BoardDetail added in v0.29.0

type BoardDetail struct {
	BBoardID  bbs.BBoardID    `bson:"bid"`
	Brdname   string          `bson:"brdname"`
	Title     string          `bson:"title"`
	BrdAttr   ptttype.BrdAttr `bson:"flag"`
	BoardType string          `bson:"the_type"`
	Category  string          `bson:"class"`
	NUser     int             `bson:"nuser"` /* use aggregate to periodically get the data */
	BMs       []bbs.UUserID   `bson:"bms"`
	Total     int             `bson:"total"` /* total articles, 需要即時知道. 因為 read 頻率高. 並且跟 last-post-time-ts 一樣 write 頻率 << read 頻率 */

	LastPostTime types.NanoTS `bson:"last_post_time_nano_ts"` /* 需要即時知道來做板的已讀 */

	UpdateTime types.NanoTS `bson:"update_time_nano_ts"` /* show 進板畫面, 目前只有 INT_MAX - 1 或 0 */

	VoteLimitLogins  int `bson:"vote_limit_logins"`
	PostLimitLogins  int `bson:"post_limit_logins"`
	VoteLimitBadpost int `bson:"vote_limit_bad_post"`
	PostLimitBadpost int `bson:"post_limit_bad_post"`

	Parent bbs.BBoardID `bson:"parent"`

	NVote           int          `bson:"vote"` /* use db-count to get current #vote */
	VoteClosingTime types.NanoTS `bson:"vtime_nano_ts"`

	Level              ptttype.PERM `bson:"perm"`
	LastSetTime        types.NanoTS `bson:"last_set_time_nano_ts"` /* perm-reload */
	PostExpire         ptttype.Bid  `bson:"post_expire"`           /* 看板連結的 bid */
	PostType           []string     `bson:"post_type"`
	PostTemplate       []bool       `bson:"post_tmpl"`
	EndGambleNanoTS    types.NanoTS `bson:"end_gamble_nano_ts"`
	FastRecommendPause types.NanoTS `bson:"fast_recommend_pause_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	Gid        ptttype.Bid `bson:"pttgid"`
	Bid        ptttype.Bid `bson:"pttbid"`
	IdxByName  string      `bson:"pttidxname"`
	IdxByClass string      `bson:"pttidxclass"`

	ChessCountry ptttype.ChessCode `bson:"chesscountry"`
}

func GetBoardDetail added in v0.29.0

func GetBoardDetail(bboardID bbs.BBoardID, fields map[string]bool) (result *BoardDetail, err error)

func NewBoardDetail added in v0.29.0

func NewBoardDetail(b_b *bbs.BoardDetail, updateNanoTS types.NanoTS) *BoardDetail

type BoardFriend added in v0.3.2

type BoardFriend struct {
	BoardID bbs.BBoardID `bson:"bid"`
	UserID  bbs.UUserID  `bson:"user_id"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type BoardID added in v0.17.0

type BoardID struct {
	BBoardID bbs.BBoardID `bson:"bid"`
	Brdname  string       `bson:"brdname"`
}

func GetBoardIDs added in v0.26.0

func GetBoardIDs(startBrdname string, descending bool, limit int, withDeleted bool) (result []*BoardID, err error)

type BoardQuery added in v0.4.0

type BoardQuery struct {
	BBoardID bbs.BBoardID `bson:"bid"`

	IsDeleted interface{} `bson:"deleted,omitempty"`
}

type BoardSummary added in v0.4.0

type BoardSummary struct {
	BBoardID  bbs.BBoardID    `bson:"bid"`
	Brdname   string          `bson:"brdname"`
	Title     string          `bson:"title"`
	BrdAttr   ptttype.BrdAttr `bson:"flag"`
	BoardType string          `bson:"the_type"`
	Category  string          `bson:"class"`
	NUser     int             `bson:"nuser"`
	BMs       []bbs.UUserID   `bson:"bms"`
	Total     int             `bson:"total"` /* total articles, 需要即時知道. 因為 read 頻率高. 並且跟 last-post-time-ts 一樣 write 頻率 << read 頻率 */

	LastPostTime types.NanoTS `bson:"last_post_time_nano_ts"` /* 需要即時知道來做板的已讀 */

	IsDeleted bool `bson:"deleted,omitempty"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	Gid        ptttype.Bid `bson:"pttgid"`
	Bid        ptttype.Bid `bson:"pttbid"`
	IdxByName  string      `bson:"pttidxname"`
	IdxByClass string      `bson:"pttidxclass"`
}

BoardSummary

func GetBoardSummariesByClsID added in v0.21.0

func GetBoardSummariesByClsID(clsID ptttype.Bid, startIdx string, isAsc bool, limit int, sortBy ptttype.BSortBy) (boardSummaries []*BoardSummary, err error)

func GetBoardSummary added in v0.4.0

func GetBoardSummary(bboardID bbs.BBoardID) (result *BoardSummary, err error)

func NewBoardSummary added in v0.4.0

func NewBoardSummary(b_b *bbs.BoardSummary, updateNanoTS types.NanoTS) *BoardSummary

func NewBoardSummaryFromPBBoard added in v0.25.0

func NewBoardSummaryFromPBBoard(b_b *boardd.Board, updateNanoTS types.NanoTS) *BoardSummary

type Client

type Client struct {
	ClientID     string           `bson:"client_id"`
	ClientSecret string           `bson:"client_secret"`
	ClientType   types.ClientType `bson:"client_type"`
	RemoteAddr   string           `bson:"ip"`
	UpdateNanoTS types.NanoTS     `bson:"update_nano_ts"`
}

func GetClient added in v0.4.0

func GetClient(clientID string) (ret *Client, err error)

func NewClient added in v0.4.0

func NewClient(clientID string, clientType types.ClientType, remoteAddr string) *Client

type Comment added in v0.3.2

type Comment struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`

	//XXX currently it's very hard to maintain the comment-id.
	//if we do comment-id only based on MD5:
	//  got duplicated md5-id if the owner posts the same comments
	//  within 1 min.
	//
	//if we add the inferred CreateTime into the comment-id:
	//  the CreateTime may be changed if the author deletes
	//  some other comments within same minute.
	CommentID    types.CommentID     `bson:"cid"`
	TheType      ptttype.CommentType `bson:"type"`
	RefIDs       []types.CommentID   `bson:"refids"`
	IsDeleted    bool                `bson:"deleted,omitempty"`
	DeleteReason string              `bson:"delete_reason,omitempty"`
	CreateTime   types.NanoTS        `bson:"create_time_nano_ts"`
	Owner        bbs.UUserID         `bson:"owner"`
	Content      [][]*types.Rune     `bson:"content"` // content in comment is colorless.
	IP           string              `bson:"ip"`
	Host         string              `bson:"host"` // ip 的中文呈現, 外國則為國家.
	MD5          string              `bson:"md5"`

	FirstCreateTime    types.NanoTS `bson:"first_create_time_nano_ts,omitempty"`    // create-time from first-comments.
	InferredCreateTime types.NanoTS `bson:"inferred_create_time_nano_ts,omitempty"` // create-time from inferred.
	NewCreateTime      types.NanoTS `bson:"new_create_time_nano_ts,omitempty"`      // create-time from new comment.

	SortTime types.NanoTS `bson:"sort_time_nano_ts"`

	TheDate string `bson:"the_date"`
	DBCS    []byte `json:"-" bson:"dbcs"`
	DBCSStr string `json:"-" bson:"dbcsstr"`

	EditNanoTS types.NanoTS `bson:"edit_nano_ts"` // for reply.

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func GetComments added in v0.10.0

func GetComments(boardID bbs.BBoardID, articleID bbs.ArticleID, sortNanoTS types.NanoTS, commentID types.CommentID, descending bool, limit int) (comments []*Comment, err error)

GetComments

func (*Comment) CleanComment added in v0.4.0

func (c *Comment) CleanComment()

func (*Comment) CleanReply added in v0.4.0

func (c *Comment) CleanReply()

func (*Comment) SetSortTime added in v0.15.0

func (c *Comment) SetSortTime(sortTime types.NanoTS)

type CommentArticleQuery added in v0.4.0

type CommentArticleQuery struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`
}

type CommentDBCS added in v0.22.0

type CommentDBCS struct {
	BBoardID  bbs.BBoardID    `bson:"bid"`
	ArticleID bbs.ArticleID   `bson:"aid"`
	CommentID types.CommentID `bson:"cid"`

	SortTime types.NanoTS `bson:"sort_time_nano_ts"`
	DBCS     []byte       `bson:"dbcs"`
}

func GetAllCommentDBCSs added in v0.22.0

func GetAllCommentDBCSs(boardID bbs.BBoardID, articleID bbs.ArticleID) (commentDBCS []*CommentDBCS, err error)

type CommentIsDeleted added in v0.4.0

type CommentIsDeleted struct {
	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type CommentMD5 added in v0.15.0

type CommentMD5 struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`

	CommentID types.CommentID     `bson:"cid"`
	TheType   ptttype.CommentType `bson:"type"`

	CreateTime types.NanoTS `bson:"create_time_nano_ts"`
	MD5        string       `bson:"md5"`

	FirstCreateTime    types.NanoTS `bson:"first_create_time_nano_ts,omitempty"`    // create-time from first-comments.
	InferredCreateTime types.NanoTS `bson:"inferred_create_time_nano_ts,omitempty"` // create-time from inferred.
	NewCreateTime      types.NanoTS `bson:"new_create_time_nano_ts,omitempty"`      // create-time from new comment.

	SortTime types.NanoTS `bson:"sort_time_nano_ts"`
	TheDate  string       `bson:"the_date"`

	EditNanoTS types.NanoTS `bson:"edit_nano_ts"` // for reply.
}

func GetAllCommentMD5s added in v0.15.0

func GetAllCommentMD5s(boardID bbs.BBoardID, articleID bbs.ArticleID) (commentMD5s []*CommentMD5, err error)

type CommentQuery added in v0.4.0

type CommentQuery struct {
	BBoardID  bbs.BBoardID    `bson:"bid"`
	ArticleID bbs.ArticleID   `bson:"aid"`
	CommentID types.CommentID `bson:"cid"`
}

type CommentSortTime added in v0.22.0

type CommentSortTime struct {
	CommentID types.CommentID `bson:"cid"`
	SortTime  types.NanoTS    `bson:"sort_time_nano_ts"`
}

type CommentSummary added in v0.4.0

type CommentSummary struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`

	CommentID types.CommentID     `bson:"cid"`
	TheType   ptttype.CommentType `bson:"type"`
	IsDeleted bool                `bson:"deleted,omitempty"`

	CreateTime   types.NanoTS `bson:"create_time_nano_ts"`
	Owner        bbs.UUserID  `bson:"owner"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	Content  [][]*types.Rune `bson:"content"` // content in comment is
	SortTime types.NanoTS    `bson:"sort_time_nano_ts"`
}

func GetBasicCommentSummariesByOwnerID added in v0.19.0

func GetBasicCommentSummariesByOwnerID(ownerID bbs.UUserID, startSortTime types.NanoTS, descending bool, limit int) (result []*CommentSummary, err error)

func GetCommentSummaries added in v0.4.0

func GetCommentSummaries(bboardID bbs.BBoardID, articleID bbs.ArticleID, startNanoTS types.NanoTS, endNanoTS types.NanoTS) (commentSummaries []*CommentSummary, err error)

GetCommentSummaries

get comment summaries with startNanoTS <= createTime < endNanoTS (excluding endNanoTS)

type ContentBlock added in v0.24.0

type ContentBlock struct {
	BBoardID  bbs.BBoardID    `bson:"bid"` //
	ArticleID bbs.ArticleID   `bson:"aid"` //
	ContentID types.ContentID `bson:"Cid"`
	Idx       int             `bson:"idx"`
	IsDeleted bool            `bson:"deleted,omitempty"` //

	Content [][]*types.Rune `bson:"content"` //

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func GetAllContentBlocks added in v0.24.0

func GetAllContentBlocks(boardID bbs.BBoardID, articleID bbs.ArticleID, contentID types.ContentID) (contentBlocks []*ContentBlock, err error)

func GetAllManContentBlocks added in v0.28.0

func GetAllManContentBlocks(boardID bbs.BBoardID, articleID types.ManArticleID, contentID types.ContentID) (contentBlocks []*ContentBlock, err error)

func GetContentBlock added in v0.24.0

func GetContentBlock(boardID bbs.BBoardID, articleID bbs.ArticleID, contentID types.ContentID, idx int) (contentBlock *ContentBlock, err error)

func GetContentBlocks added in v0.24.0

func GetContentBlocks(boardID bbs.BBoardID, articleID bbs.ArticleID, contentID types.ContentID, startIdx int, n int64) (contentBlocks []*ContentBlock, err error)

func GetManContentBlock added in v0.28.0

func GetManContentBlock(boardID bbs.BBoardID, articleID types.ManArticleID, contentID types.ContentID, idx int) (contentBlock *ContentBlock, err error)

func GetManContentBlocks added in v0.28.0

func GetManContentBlocks(boardID bbs.BBoardID, articleID types.ManArticleID, contentID types.ContentID, startIdx int, n int64) (contentBlocks []*ContentBlock, err error)

type ContentBlockQuery added in v0.24.0

type ContentBlockQuery struct {
	BBoardID  bbs.BBoardID    `bson:"bid"`
	ArticleID bbs.ArticleID   `bson:"aid"`
	ContentID types.ContentID `bson:"Cid"`
	Idx       int             `bson:"idx"`
}

type FolderMeta added in v0.9.0

type FolderMeta struct {
	FavNum   int `bson:"fav_num"`
	NBoards  int `bson:"n_boards"`
	NLines   int `bson:"n_lines"`
	NFolders int `bson:"n_folders"`
}

type LevelIdx added in v0.9.0

type LevelIdx string

func SetLevelIdx added in v0.9.0

func SetLevelIdx(prefix LevelIdx, idx int) LevelIdx

type ManArticle added in v0.28.0

type ManArticle struct {
	Version    int                `bson:"version"`
	BBoardID   bbs.BBoardID       `bson:"bid"`                 //
	ArticleID  types.ManArticleID `bson:"aid"`                 //
	LevelIdx   types.ManArticleID `bson:"level_idx"`           //
	IsDeleted  bool               `bson:"deleted,omitempty"`   //
	CreateTime types.NanoTS       `bson:"create_time_nano_ts"` //
	MTime      types.NanoTS       `bson:"mtime_nano_ts"`

	Title    string           `bson:"title"` //
	Filemode ptttype.FileMode `bson:"mode"`  //

	IsDir bool `bson:"is_dir"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"` // used by article-summary

	ContentMTime types.NanoTS    `bson:"content_mtime_nano_ts"` //
	ContentMD5   string          `bson:"content_md5"`
	ContentID    types.ContentID `bson:"content_id"`
	Content      [][]*types.Rune `bson:"content"`

	ContentUpdateNanoTS types.NanoTS `bson:"content_update_nano_ts"`

	Idx int `bson:"pttidx"`
}

type ManArticleContentInfo added in v0.28.0

type ManArticleContentInfo struct {
	ContentMD5          string          `bson:"content_md5"`
	ContentID           types.ContentID `bson:"content_id"`
	Content             [][]*types.Rune `bson:"content"`
	ContentUpdateNanoTS types.NanoTS    `bson:"content_update_nano_ts"`
}

func GetManArticleContentInfo added in v0.28.0

func GetManArticleContentInfo(bboardID bbs.BBoardID, articleID types.ManArticleID, isContent bool) (contentInfo *ManArticleContentInfo, err error)

type ManArticleContentMTime added in v0.28.0

type ManArticleContentMTime struct {
	ContentMTime types.NanoTS `bson:"content_mtime_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"` //

}

func GetManArticleContentMTime added in v0.28.0

func GetManArticleContentMTime(bboardID bbs.BBoardID, articleID types.ManArticleID) (ret *ManArticleContentMTime, err error)

type ManArticleDetailSummary added in v0.28.0

type ManArticleDetailSummary struct {
	BBoardID   bbs.BBoardID       `bson:"bid"`                 //
	ArticleID  types.ManArticleID `bson:"aid"`                 //
	IsDeleted  bool               `bson:"deleted,omitempty"`   //
	LevelIdx   types.ManArticleID `bson:"level_idx"`           //
	CreateTime types.NanoTS       `bson:"create_time_nano_ts"` //
	MTime      types.NanoTS       `bson:"mtime_nano_ts"`

	Title string `bson:"title"` //
	IsDir bool   `bson:"is_dir"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"` // used by article-summary

	ContentMTime types.NanoTS    `bson:"content_mtime_nano_ts"` //
	ContentMD5   string          `bson:"content_md5"`
	ContentID    types.ContentID `bson:"content_id"`

	ContentUpdateNanoTS types.NanoTS `bson:"content_update_nano_ts"`

	Idx int `bson:"pttidx"`
}

func GetManArticleDetailSummaries added in v0.28.0

func GetManArticleDetailSummaries(boardID bbs.BBoardID, levelIdx types.ManArticleID) (result []*ManArticleDetailSummary, err error)

func GetManArticleDetailSummary added in v0.28.0

func GetManArticleDetailSummary(bboardID bbs.BBoardID, articleID types.ManArticleID) (result *ManArticleDetailSummary, err error)

type ManArticleQuery added in v0.28.0

type ManArticleQuery struct {
	BBoardID bbs.BBoardID       `bson:"bid"`
	LevelIdx types.ManArticleID `bson:"level_idx"` //
	Idx      int                `bson:"pttidx"`
}

type ManArticleSummary added in v0.28.0

type ManArticleSummary struct {
	BBoardID bbs.BBoardID `bson:"bid"` //

	ArticleID types.ManArticleID `bson:"aid"`       //
	LevelIdx  types.ManArticleID `bson:"level_idx"` //

	CreateTime types.NanoTS `bson:"create_time_nano_ts"` //
	MTime      types.NanoTS `bson:"mtime_nano_ts"`

	Title string `bson:"title"` //
	IsDir bool   `bson:"is_dir"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"` // used by article-summary

	Idx int `bson:"pttidx"`
}

func GetManArticleSummaries added in v0.28.0

func GetManArticleSummaries(boardID bbs.BBoardID, LevelIdx types.ManArticleID) (result []*ManArticleSummary, err error)

func NewManArticleSummaryFromPB added in v0.28.0

func NewManArticleSummaryFromPB(entry *mand.Entry, boardID bbs.BBoardID, levelIdx types.ManArticleID, updateNanoTS types.NanoTS, idx int) (articleSummary *ManArticleSummary)

type Rank added in v0.14.0

type Rank struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`
	Owner     bbs.UUserID   `bson:"owner"`

	Rank int `bson:"rank"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type RankAgged added in v0.14.0

type RankAgged struct {
	BBoardID  bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`

	Rank int `bson:"rank"`
}

func SumRankByBoardID added in v0.14.0

func SumRankByBoardID(boardID bbs.BBoardID, articleIDs []bbs.ArticleID) (ret []*RankAgged, err error)

type RankIsDeleted added in v0.23.0

type RankIsDeleted struct {
	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type User

type User struct {
	Version  int         `bson:"version"`
	UserID   bbs.UUserID `bson:"user_id"`
	Username string      `bson:"username"`
	Realname string      `bson:"realtime"`
	Nickname string      `bson:"nickname"`

	Uflag        ptttype.UFlag `bson:"flag"`
	Userlevel    ptttype.PERM  `bson:"perm"`
	Numlogindays int           `bson:"login_days"` /* 考慮透過 db-count, 但是可能無法跟以前版本相容 */
	Numposts     int           `bson:"posts"`      /* 考慮透過 db-count, 因為 post 可能會被消失, 但是這個欄位不應該因為被消失的而減少? (poster 主動消失的需要減少)? */
	Firstlogin   types.NanoTS  `bson:"first_login_nano_ts"`
	Lastlogin    types.NanoTS  `bson:"last_login_nano_ts"` /* 考慮透過 db-max, 但是可能在拉 user-detail 時會花很多時間. */
	LastIP       string        `bson:"last_ip"`
	LastHost     string        `bson:"last_host"` // last-ip 的中文呈現, 外國則為國家.

	Money    int    `bson:"money"`
	PttEmail string `bson:"pttemail"`
	Justify  string `bson:"justify"`
	Over18   bool   `bson:"over18"`

	PagerUIType uint8             `bson:"pager_ui"` /* 呼叫器界面類別 (was: WATER_*) */
	Pager       ptttype.PagerMode `bson:"pager"`    /* 呼叫器狀態 */
	Invisible   bool              `bson:"hide"`
	Exmailbox   uint32            `bson:"exmail"`

	Career        string       `bson:"career"`
	Role          uint32       `bson:"role"`
	LastSeen      types.NanoTS `bson:"last_seen_nano_ts"`
	TimeSetAngel  types.NanoTS `bson:"time_set_angel_nano_ts"`
	TimePlayAngel types.NanoTS `bson:"time_play_angel_nano_ts"`

	LastSong  types.NanoTS `bson:"last_song_nano_ts"`
	LoginView uint32       `bson:"login_view"`

	Vlcount   int   `bson:"violation"`
	FiveWin   int   `bson:"five_win"`
	FiveLose  int   `bson:"five_lose"`
	FiveTie   int   `bson:"five_tie"`
	ChcWin    int   `bson:"chc_win"`
	ChcLose   int   `bson:"chc_lose"`
	ChcTie    int   `bson:"chc_tie"`
	Conn6Win  int   `bson:"conn6_win"`
	Conn6Lose int   `bson:"conn6_lose"`
	Conn6Tie  int   `bson:"conn6_tie"`
	GoWin     int   `bson:"go_win"`
	GoLose    int   `bson:"go_lose"`
	GoTie     int   `bson:"go_tie"`
	DarkWin   int   `bson:"dark_win"`
	DarkLose  int   `bson:"dark_lose"`
	DarkTie   int   `bson:"dark_tie"` /* 暗棋戰績 和 */
	UaVersion uint8 `bson:"ua_version"`

	Signature uint8       `bson:"signaure"` /* 慣用簽名檔 */
	BadPost   int         `bson:"bad_post"` /* 評價為壞文章數 */
	MyAngel   bbs.UUserID `bson:"angel"`    /* 我的小天使 */

	ChessEloRating int `bson:"chess_rank"` /* 象棋等級 */

	TimeRemoveBadPost types.NanoTS `bson:"time_remove_bad_post_nano_ts"`
	TimeViolateLaw    types.NanoTS `bson:"time_violate_law_nano_ts"`

	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	UserLevel2    ptttype.PERM2 `bson:"perm2"`
	UpdateNanoTS2 types.NanoTS  `bson:"update_nano_ts2"`

	// NFriend int `bson:"n_friend"` /* 需要透過 db-count */
	Avatar       []byte       `bson:"avatar"`
	AvatarNanoTS types.NanoTS `bson:"avatar_nano_ts"`
}

type UserAloha added in v0.3.2

type UserAloha struct {
	// 上站通知名單
	UserID  bbs.UUserID `bson:"user_id"`
	AlohaID bbs.UUserID `bson:"aloha_id"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type UserDetail added in v0.6.0

type UserDetail struct {
	UserID   bbs.UUserID `bson:"user_id"`
	Username string      `bson:"username"`
	Realname string      `bson:"realtime"`
	Nickname string      `bson:"nickname"`

	Uflag        ptttype.UFlag `bson:"flag"`
	Userlevel    ptttype.PERM  `bson:"perm"`
	Numlogindays int           `bson:"login_days"` /* 考慮透過 db-count, 但是可能無法跟以前版本相容 */
	Numposts     int           `bson:"posts"`      /* 考慮透過 db-count, 因為 post 可能會被消失, 但是這個欄位不應該因為被消失的而減少? (poster 主動消失的需要減少)? */
	Firstlogin   types.NanoTS  `bson:"first_login_nano_ts"`
	Lastlogin    types.NanoTS  `bson:"last_login_nano_ts"` /* 考慮透過 db-max, 但是可能在拉 user-detail 時會花很多時間. */
	LastIP       string        `bson:"last_ip"`
	LastHost     string        `bson:"last_host"` // last-ip 的中文呈現, 外國則為國家.

	Money    int    `bson:"money"`
	PttEmail string `bson:"pttemail"`
	Justify  string `bson:"justify"`
	Over18   bool   `bson:"over18"`

	PagerUIType uint8             `bson:"pager_ui"` /* 呼叫器界面類別 (was: WATER_*) */
	Pager       ptttype.PagerMode `bson:"pager"`    /* 呼叫器狀態 */
	Invisible   bool              `bson:"hide"`
	Exmailbox   uint32            `bson:"exmail"`

	Career        string       `bson:"career"`
	Role          uint32       `bson:"role"`
	LastSeen      types.NanoTS `bson:"last_seen_nano_ts"`
	TimeSetAngel  types.NanoTS `bson:"time_set_angel_nano_ts"`
	TimePlayAngel types.NanoTS `bson:"time_play_angel_nano_ts"`

	LastSong  types.NanoTS `bson:"last_song_nano_ts"`
	LoginView uint32       `bson:"login_view"`

	Vlcount   int   `bson:"violation"`
	FiveWin   int   `bson:"five_win"`
	FiveLose  int   `bson:"five_lose"`
	FiveTie   int   `bson:"five_tie"`
	ChcWin    int   `bson:"chc_win"`
	ChcLose   int   `bson:"chc_lose"`
	ChcTie    int   `bson:"chc_tie"`
	Conn6Win  int   `bson:"conn6_win"`
	Conn6Lose int   `bson:"conn6_lose"`
	Conn6Tie  int   `bson:"conn6_tie"`
	GoWin     int   `bson:"go_win"`
	GoLose    int   `bson:"go_lose"`
	GoTie     int   `bson:"go_tie"`
	DarkWin   int   `bson:"dark_win"`
	DarkLose  int   `bson:"dark_lose"`
	DarkTie   int   `bson:"dark_tie"` /* 暗棋戰績 和 */
	UaVersion uint8 `bson:"ua_version"`

	Signature uint8       `bson:"signaure"` /* 慣用簽名檔 */
	BadPost   int         `bson:"bad_post"` /* 評價為壞文章數 */
	MyAngel   bbs.UUserID `bson:"angel"`    /* 我的小天使 */

	ChessEloRating int `bson:"chess_rank"` /* 象棋等級 */

	TimeRemoveBadPost types.NanoTS `bson:"time_remove_bad_post_nano_ts"`
	TimeViolateLaw    types.NanoTS `bson:"time_violate_law_nano_ts"`

	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`

	UserLevel2    ptttype.PERM2 `bson:"perm2"`
	UpdateNanoTS2 types.NanoTS  `bson:"update_nano_ts2"`
}

func NewUserDetail added in v0.6.0

func NewUserDetail(user_b pttbbsapi.GetUserResult, updateNanoTS types.NanoTS) (user *UserDetail)

type UserEmail added in v0.8.3

type UserEmail struct {
	UserID bbs.UUserID `bson:"user_id"`
	Email  string      `bson:"email"`

	IsSet bool `bson:"is_set,omitempty"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func GetUserEmailByEmail added in v0.8.3

func GetUserEmailByEmail(email string, updateNanoTS types.NanoTS) (userEmail *UserEmail, err error)

func GetUserEmailByUserID added in v0.8.3

func GetUserEmailByUserID(userID bbs.UUserID, updateNanoTS types.NanoTS) (userEmail *UserEmail, err error)

type UserFavoriteID added in v0.31.0

type UserFavoriteID struct {
	UserID          bbs.UUserID  `bson:"user_id"`
	DoubleBufferIdx int          `bson:"dbuffer_idx"`
	MTime           types.NanoTS `bson:"mtime_nano_ts"`

	LevelIdx LevelIdx `bson:"level_idx"`

	TheType pttbbsfav.FavT `bson:"the_type"`
	TheID   int            `bson:"the_id"`
}

func GetUserFavoriteIDsByPttbids added in v0.31.0

func GetUserFavoriteIDsByPttbids(userID bbs.UUserID, doubleBufferIdx int, pttbids []ptttype.Bid, mTime types.NanoTS) (userFavoriteIDs []*UserFavoriteID, err error)

type UserFavorites added in v0.9.0

type UserFavorites struct {
	UserID          bbs.UUserID  `bson:"user_id"`
	DoubleBufferIdx int          `bson:"dbuffer_idx"`
	FavIdx          int          `bson:"fav_idx"`
	LevelIdx        LevelIdx     `bson:"level_idx"`
	Idx             int          `bson:"idx"`
	UpdateNanoTS    types.NanoTS `bson:"update_nano_ts"`
	MTime           types.NanoTS `bson:"mtime_nano_ts"`

	TheType pttbbsfav.FavT `bson:"the_type"`
	Attr    pttbbsfav.Favh `bson:"attr"`
	TheID   int            `bson:"the_id"`

	// for folder
	FolderTitle string      `bson:"folder_title"`
	FolderMeta  *FolderMeta `bson:"folder_meta"`
}

favorites is bounded by 1024 items. each item can be at most 100 bytes. We should be able to have all the favorites inside 1 document.

func GetAllUserFavorites added in v0.30.1

func GetAllUserFavorites(userID bbs.UUserID, doubleBufferIdx int, mTime types.NanoTS) (userFavorites []*UserFavorites, err error)

func GetUserFavorites added in v0.9.0

func GetUserFavorites(userID bbs.UUserID, doubleBufferIdx int, levelIdx LevelIdx, startIdx int, ascending bool, limit int, mTime types.NanoTS) (userFavorites []*UserFavorites, err error)

func SortUserFavoritesByFavIdx added in v0.9.0

func SortUserFavoritesByFavIdx(userFavorites []*UserFavorites, ascending bool) (newUserFavorites []*UserFavorites)

type UserFavoritesMeta added in v0.9.0

type UserFavoritesMeta struct {
	UserID          bbs.UUserID  `bson:"user_id"`
	DoubleBufferIdx int          `bson:"db_idx"`
	UpdateNanoTS    types.NanoTS `bson:"update_nano_ts"`
	MTime           types.NanoTS `bson:"mtime_nano_ts"`
	FolderMeta      FolderMeta   `bson:"folder_meta"`
}

func GetUserFavoritesMeta added in v0.9.0

func GetUserFavoritesMeta(userID bbs.UUserID) (result *UserFavoritesMeta, err error)

type UserFavoritesMetaSummary added in v0.9.0

type UserFavoritesMetaSummary struct {
	UserID          bbs.UUserID  `bson:"user_id"`
	DoubleBufferIdx int          `bson:"db_idx"`
	MTime           types.NanoTS `bson:"mtime_nano_ts"`
}

func GetUserFavoritesMetaSummary added in v0.9.0

func GetUserFavoritesMetaSummary(userID bbs.UUserID) (result *UserFavoritesMetaSummary, err error)

type UserFavoritesNanoTS added in v0.9.0

type UserFavoritesNanoTS struct {
	UserID       bbs.UUserID  `bson:"user_id"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type UserFavoritesQuery added in v0.9.0

type UserFavoritesQuery struct {
	UserID          bbs.UUserID `bson:"user_id"`
	DoubleBufferIdx int         `bson:"dbuffer_idx"`
	FavIdx          int         `bson:"fav_idx"`
}

type UserFriend added in v0.3.2

type UserFriend struct {
	UserID   bbs.UUserID `bson:"user_id"`
	FriendID bbs.UUserID `bson:"friend_id"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type UserIDEmail added in v0.8.0

type UserIDEmail struct {
	UserID  bbs.UUserID `bson:"user_id"`
	IDEmail string      `bson:"idemail"`

	IsSet bool `bson:"is_set,omitempty"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func GetUserIDEmailByEmail added in v0.8.0

func GetUserIDEmailByEmail(email string, updateNanoTS types.NanoTS) (userIDEmail *UserIDEmail, err error)

func GetUserIDEmailByUserID added in v0.8.0

func GetUserIDEmailByUserID(userID bbs.UUserID, updateNanoTS types.NanoTS) (userIDEmail *UserIDEmail, err error)

type UserInfoSummary added in v0.6.0

type UserInfoSummary struct {
	UserID       bbs.UUserID  `bson:"user_id"`
	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func GetUserInfoSummary added in v0.6.0

func GetUserInfoSummary(userID bbs.UUserID) (result *UserInfoSummary, err error)

type UserNewInfo added in v0.6.0

type UserNewInfo struct {
	Avatar       []byte       `bson:"avatar"`
	AvatarNanoTS types.NanoTS `bson:"avatar_nano_ts"`

	IsDeleted bool `bson:"deleted,omitempty"`
}

func GetUserNewInfo added in v0.6.0

func GetUserNewInfo(userID bbs.UUserID) (result *UserNewInfo, err error)

type UserNickname added in v0.22.1

type UserNickname struct {
	Username string `bson:"username"`
	Nickname string `bson:"nickname"`
}

type UserQuery added in v0.6.0

type UserQuery struct {
	UserID    bbs.UUserID `bson:"user_id"`
	IsDeleted interface{} `bson:"deleted,omitempty"`
}

type UserReadArticle

type UserReadArticle struct {
	UserID       bbs.UUserID   `bson:"user_id"`
	BoardID      bbs.BBoardID  `bson:"bid"`
	ArticleID    bbs.ArticleID `bson:"aid"`
	UpdateNanoTS types.NanoTS  `bson:"update_nano_ts"`
}

func FindUserReadArticles added in v0.4.0

func FindUserReadArticles(userID bbs.UUserID, boardID bbs.BBoardID, articleIDs []bbs.ArticleID) ([]*UserReadArticle, error)

func FindUserReadArticlesByArticleIDs added in v0.19.0

func FindUserReadArticlesByArticleIDs(userID bbs.UUserID, articleIDs []bbs.ArticleID) ([]*UserReadArticle, error)

type UserReadArticleIsDeleted added in v0.23.0

type UserReadArticleIsDeleted struct {
	IsDeleted    bool         `bson:"deleted,omitempty"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type UserReadArticleQuery added in v0.4.0

type UserReadArticleQuery struct {
	UserID    bbs.UUserID   `bson:"user_id"`
	BoardID   bbs.BBoardID  `bson:"bid"`
	ArticleID bbs.ArticleID `bson:"aid"`
}

type UserReadBoard

type UserReadBoard struct {
	UserID       bbs.UUserID  `bson:"user_id"`
	BBoardID     bbs.BBoardID `bson:"bid"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

func FindUserReadBoards added in v0.4.0

func FindUserReadBoards(userID bbs.UUserID, boardIDs []bbs.BBoardID) ([]*UserReadBoard, error)

type UserReadBoardQuery added in v0.4.0

type UserReadBoardQuery struct {
	UserID   bbs.UUserID  `bson:"user_id"`
	BBoardID bbs.BBoardID `bson:"bid"`
}

type UserReject added in v0.3.2

type UserReject struct {
	UUserID  bbs.UUserID `bson:"user_id"`
	RejectID bbs.UUserID `bson:"reject_id"`

	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

type UserVisit added in v0.24.0

type UserVisit struct {
	UserID       bbs.UUserID  `bson:"user_id"`
	Action       string       `bson:"action"`
	UpdateNanoTS types.NanoTS `bson:"update_nano_ts"`
}

Jump to

Keyboard shortcuts

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