Documentation ¶
Index ¶
- Variables
- func ChangeEmail(uuserID UUserID, email string) (err error)
- func ChangePasswd(userID UUserID, origPasswd string, passwd string, ip string) (err error)
- func CheckPasswd(uuserID UUserID, passwd string, ip string) (err error)
- func CreateComment(userID UUserID, boardID BBoardID, articleID ArticleID, ...) (comment []byte, mtime types.Time4, err error)
- func DeserializeBoardIdxByClassStr(idxStr string) (boardClass []byte, brdname string, err error)
- func DeserializeBoardIdxByNameStr(idxStr string) (brdname string, err error)
- func EditArticle(uuserID UUserID, bboardID BBoardID, articleID ArticleID, posttype []byte, ...) (newContent []byte, mtime types.Time4, newTitle []byte, newClass []byte, ...)
- func GetArticle(uuserID UUserID, bboardID BBoardID, articleID ArticleID, ...) (content []byte, mtime types.Time4, sum cmsys.Fnv64_t, err error)
- func GetFavorites(uuserID UUserID, retrieveTS types.Time4) (content []byte, mtime types.Time4, err error)
- func GetPostTemplate(uuserID UUserID, bboardID BBoardID, templateID ptttype.SortIdx, ...) (content []byte, mtime types.Time4, sum cmsys.Fnv64_t, err error)
- func GetUserVisitCount() int32
- func IsBoardValidUser(uuserID UUserID, boardID BBoardID) (isValid bool, err error)
- func IsBoardsValidUser(uuserID UUserID, boardIDs []BBoardID) (isValid map[BBoardID]bool, err error)
- func IsSysop(uuserID UUserID, perm ptttype.PERM) (isValid bool)
- func IsValidIDEmail(email string) (err error)
- func ReloadUHash(uuserID UUserID) (err error)
- func SerializeArticleIdxStr(summary *ArticleSummary) (idxStr string)
- func SerializeBoardIdxByClassStr(boardClass []byte, brdname string) (idxStr string)
- func SerializeBoardIdxByNameStr(brdname string) (idxStr string)
- func SetIDEmail(uuserID UUserID, isSet bool) (userLevel2 ptttype.PERM2, err error)
- func SetUserPerm(userID UUserID, setUserID UUserID, perm ptttype.PERM) (newPerm ptttype.PERM, err error)
- func WriteFavorites(uuserID UUserID, content []byte) (mtime types.Time4, err error)
- type ArticleID
- type ArticleSummary
- func CreateArticle(uuserID UUserID, bboardID BBoardID, posttype []byte, title []byte, ...) (summary *ArticleSummary, err error)
- func CrossPost(uuserID UUserID, bboardID BBoardID, articleID ArticleID, xboardID BBoardID, ...) (articleSummary *ArticleSummary, comment []byte, commentMTime types.Time4, ...)
- func LoadBottomArticles(uuserID UUserID, bboardID BBoardID) (summaries []*ArticleSummary, err error)
- func LoadGeneralArticles(uuserID UUserID, bboardID BBoardID, startIdxStr string, nArticles int, ...) (summaries []*ArticleSummary, nextIdxStr string, nextCreateTime types.Time4, ...)
- func NewArticleSummaryFromRaw(bboardID BBoardID, articleSummaryRaw *ptttype.ArticleSummaryRaw) *ArticleSummary
- type BBoardID
- type BoardDetail
- func LoadBoardDetail(uuserID UUserID, bboardID BBoardID) (detail *BoardDetail, err error)
- func LoadGeneralBoardDetails(uuserID UUserID, startIdxStr string, nBoards int, isAsc bool, ...) (details []*BoardDetail, nextIdxStr string, err error)
- func NewBoardDetailFromRaw(boardDetailRaw *ptttype.BoardDetailRaw, bid ptttype.Bid) *BoardDetail
- type BoardSummary
- func CreateBoard(userID UUserID, clsBid ptttype.Bid, brdname string, brdClass []byte, ...) (summary *BoardSummary, err error)
- func LoadAutoCompleteBoards(uuserID UUserID, startIdxStr string, nBoards int, keyword string, isAsc bool) (summaries []*BoardSummary, nextIdxStr string, err error)
- func LoadBoardSummary(uuserID UUserID, bboardID BBoardID) (summary *BoardSummary, err error)
- func LoadBoardsByBids(uuserID UUserID, bids []ptttype.Bid) (summaries []*BoardSummary, err error)
- func LoadClassBoards(uuserID UUserID, clsBid ptttype.Bid, bsortBy ptttype.BSortBy) (summaries []*BoardSummary, err error)
- func LoadFullClassBoards(uuserID UUserID, startBid ptttype.Bid, nBoards int) (summaries []*BoardSummary, nextBid ptttype.Bid, err error)
- func LoadGeneralBoards(uuserID UUserID, startIdxStr string, nBoards int, title []byte, keyword []byte, ...) (summaries []*BoardSummary, nextIdxStr string, err error)
- func LoadHotBoards(uuserID UUserID) (summary []*BoardSummary, err error)
- func NewBoardSummaryFromRaw(boardSummaryRaw *ptttype.BoardSummaryRaw) *BoardSummary
- type UUserID
- func CheckExistsUser(username string) (uuserID UUserID, err error)
- func Login(username string, passwd string, ip string) (uuserID UUserID, err error)
- func Register(username string, passwd string, ip string, email string, nickname []byte, ...) (uuserID UUserID, err error)
- func ToUUserID(userIDRaw *ptttype.UserID_t) UUserID
- type Userec
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ChangeEmail ¶ added in v0.7.0
func ChangePasswd ¶ added in v0.6.0
func CheckPasswd ¶ added in v0.7.0
func CreateComment ¶ added in v0.14.0
func DeserializeBoardIdxByClassStr ¶ added in v0.20.2
func DeserializeBoardIdxByNameStr ¶ added in v0.20.2
func EditArticle ¶ added in v0.18.0
func GetArticle ¶ added in v0.4.0
func GetFavorites ¶ added in v0.9.0
func GetPostTemplate ¶ added in v0.23.3
func GetUserVisitCount ¶ added in v0.19.2
func GetUserVisitCount() int32
func IsBoardValidUser ¶ added in v0.9.5
func IsBoardsValidUser ¶ added in v0.17.0
func IsValidIDEmail ¶ added in v0.8.1
func ReloadUHash ¶ added in v0.13.0
func SerializeArticleIdxStr ¶ added in v0.14.3
func SerializeArticleIdxStr(summary *ArticleSummary) (idxStr string)
func SerializeBoardIdxByClassStr ¶ added in v0.20.2
func SerializeBoardIdxByNameStr ¶ added in v0.20.2
func SetIDEmail ¶ added in v0.7.1
func SetUserPerm ¶ added in v0.13.1
Types ¶
type ArticleID ¶ added in v0.3.0
type ArticleID string
func DeleteArticles ¶ added in v0.19.0
func DeserializeArticleIdxStr ¶ added in v0.14.3
func ToArticleID ¶ added in v0.3.0
func ToArticleID(filename *ptttype.Filename_t) ArticleID
ToArticleID
aidc is with fixed-size (8 bytes), no need the separator to do the separation.
func (*ArticleID) ToFilename ¶ added in v0.4.0
func (a *ArticleID) ToFilename() (filename *ptttype.Filename_t)
func (ArticleID) ToRaw ¶ added in v0.4.2
func (a ArticleID) ToRaw() (filename *ptttype.Filename_t)
ToRaw
1st 8 bytes are aidc. bytes starting 8th are ownerID
type ArticleSummary ¶ added in v0.3.0
type ArticleSummary struct { BBoardID BBoardID `json:"bid"` ArticleID ArticleID `json:"aid"` IsDeleted bool `json:"deleted"` Filename string `json:"filename"` CreateTime types.Time4 `json:"create_time"` MTime types.Time4 `json:"modified"` Recommend int8 `json:"recommend"` Owner UUserID `json:"owner"` FullTitle []byte `json:"full_title"` Money int32 `json:"money"` Filemode ptttype.FileMode `json:"mode"` Class []byte `json:"class"` Read bool `json:"read"` Idx string `json:"idx"` RealTitle []byte `json:"title"` SubjectType ptttype.SubjectType `json:"subject_type"` }
func CreateArticle ¶ added in v0.12.0
func LoadBottomArticles ¶ added in v0.15.0
func LoadBottomArticles(uuserID UUserID, bboardID BBoardID) (summaries []*ArticleSummary, err error)
func LoadGeneralArticles ¶ added in v0.3.0
func LoadGeneralArticles( uuserID UUserID, bboardID BBoardID, startIdxStr string, nArticles int, isDesc bool) ( summaries []*ArticleSummary, nextIdxStr string, nextCreateTime types.Time4, isNewest bool, startNumIdx ptttype.SortIdx, err error)
LoadGeneralArticles in descending mode.
func NewArticleSummaryFromRaw ¶ added in v0.3.0
func NewArticleSummaryFromRaw(bboardID BBoardID, articleSummaryRaw *ptttype.ArticleSummaryRaw) *ArticleSummary
type BBoardID ¶ added in v0.3.0
type BBoardID string // The integrated bid-boardID, concat with _, safe because bid is number >= 1.
func ToBBoardID ¶ added in v0.3.0
ToBBoardID
concat bid and boardID as BBoardID, concat with _ because bid and boardIDRaw are from ptt, no need to check the validity
type BoardDetail ¶ added in v0.18.0
type BoardDetail struct { Brdname string `json:"brdname"` RealTitle []byte `json:"title"` // Require to separate RealTitle, BoardClass, BoardType, because it's hard to parse in utf8 BoardClass []byte `json:"class"` BoardType []byte `json:"type"` //□, ◎, Σ BM []UUserID `json:"moderators"` BrdAttr ptttype.BrdAttr `json:"attr"` Gid ptttype.Bid `json:"pttgid"` Bid ptttype.Bid `json:"pttbid"` BBoardID BBoardID `json:"bid"` ChessCountry ptttype.ChessCode `json:"chesscountry"` VoteLimitLogins uint8 `json:"votelimitlogins"` BUpdate types.Time4 `json:"bupdate"` PostLimitLogins uint8 `json:"postlimitlogins"` BVote uint8 `json:"bvote"` VTime types.Time4 `json:"vtime"` Level ptttype.PERM `json:"level"` PermReload types.Time4 `json:"permreload"` NUser int32 `json:"nuser"` PostExpire ptttype.Bid `json:"postexpire"` EndGamble types.Time4 `json:"endgamble"` PostType [][]byte `json:"posttype"` PostTypeTemplate []bool `json:"posttype_tmpl"` FastRecommendPause uint8 `json:"fastrecommendpause"` VoteLimitBadpost uint8 `json:"votelimitbadpost"` PostLimitBadPost uint8 `json:"postlimitbadpost"` LastPostTime types.Time4 `json:"last_post_time"` Total int32 `json:"total"` IdxByName string `json:"idx_name"` IdxByClass string `json:"idx_class"` Reason ptttype.RestrictReason `json:"reason"` }
func LoadBoardDetail ¶ added in v0.18.0
func LoadBoardDetail(uuserID UUserID, bboardID BBoardID) (detail *BoardDetail, err error)
func LoadGeneralBoardDetails ¶ added in v0.23.0
func NewBoardDetailFromRaw ¶ added in v0.18.0
func NewBoardDetailFromRaw(boardDetailRaw *ptttype.BoardDetailRaw, bid ptttype.Bid) *BoardDetail
type BoardSummary ¶
type BoardSummary struct { Gid ptttype.Bid `json:"pttgid"` Bid ptttype.Bid `json:"pttbid"` BBoardID BBoardID `json:"bid"` BrdAttr ptttype.BrdAttr `json:"attr"` StatAttr ptttype.BoardStatAttr `json:"user_attr"` Brdname string `json:"brdname"` RealTitle []byte `json:"title"` // Require to separate RealTitle, BoardClass, BoardType, because it's hard to parse in utf8 BoardClass []byte `json:"class"` BoardType []byte `json:"type"` //□, ◎, Σ BM []UUserID `json:"moderators"` Reason ptttype.RestrictReason `json:"reason"` LastPostTime types.Time4 `json:"last_post_time"` NUser int32 `json:"number_of_user"` Total int32 `json:"total"` Read bool `json:"read"` IdxByName string `json:"idx_name"` IdxByClass string `json:"idx_class"` }
func CreateBoard ¶ added in v0.11.1
func LoadAutoCompleteBoards ¶ added in v0.10.0
func LoadBoardSummary ¶ added in v0.8.0
func LoadBoardSummary(uuserID UUserID, bboardID BBoardID) (summary *BoardSummary, err error)
func LoadBoardsByBids ¶ added in v0.9.2
func LoadBoardsByBids(uuserID UUserID, bids []ptttype.Bid) (summaries []*BoardSummary, err error)
func LoadClassBoards ¶ added in v0.17.0
func LoadFullClassBoards ¶ added in v0.17.0
func LoadGeneralBoards ¶
func LoadHotBoards ¶ added in v0.9.0
func LoadHotBoards(uuserID UUserID) (summary []*BoardSummary, err error)
func NewBoardSummaryFromRaw ¶
func NewBoardSummaryFromRaw(boardSummaryRaw *ptttype.BoardSummaryRaw) *BoardSummary
type UUserID ¶ added in v0.3.3
type UUserID string // The integrated bid-userid, concat with _, safe because bid is number >= 1.
func CheckExistsUser ¶ added in v0.9.4
func (UUserID) ToUsername ¶ added in v0.4.0
type Userec ¶
type Userec struct { Version uint32 `json:"version"` UUserID UUserID `json:"user_id"` Username string `json:"username"` Realname []byte `json:"realname"` Nickname []byte `json:"nickname"` Uflag ptttype.UFlag `json:"flag"` // Unused1 uint32 /* 從前放習慣2, 使用前請先清0 */ Userlevel ptttype.PERM `json:"perm"` Numlogindays uint32 `json:"login_days"` Numposts uint32 `json:"posts"` Firstlogin types.Time4 `json:"first_login"` Lastlogin types.Time4 `json:"last_login"` Lasthost string `json:"last_ip"` // last IPv4. Money int32 `json:"money"` Email string `json:"email"` // Address []byte Justify []byte `json:"justify"` // UnusedBirth [3]uint8 /* 生日 月日年 */ Over18 bool `json:"over18"` PagerUIType uint8 `json:"pager_ui"` /* 呼叫器界面類別 (was: WATER_*) */ Pager ptttype.PagerMode `json:"pager"` /* 呼叫器狀態 */ Invisible bool `json:"invisible"` // Unused4 [2]byte Exmailbox uint32 `json:"exmail"` // r3968 移出 sizeof(chicken_t)=128 bytes // Unused5 [4]byte Career []byte `json:"career"` // UnusedPhone Phone_t /* 電話 */ // Unused6 uint32 /* 從前放轉換前的 numlogins, 使用前請先清0 */ // Chkpad1 [44]byte Role uint32 `json:"role"` LastSeen types.Time4 `json:"last_seen"` TimeSetAngel types.Time4 `json:"time_set_angel"` TimePlayAngel types.Time4 `json:"time_play_angel"` LastSong types.Time4 `json:"last_song"` LoginView uint32 `json:"login_view"` Vlcount uint16 `json:"violation"` FiveWin uint16 `json:"five_win"` FiveLose uint16 `json:"five_lose"` FiveTie uint16 `json:"five_tie"` ChcWin uint16 `json:"chc_win"` ChcLose uint16 `json:"chc_lose"` ChcTie uint16 `json:"chc_tie"` Conn6Win uint16 `json:"conn6_win"` Conn6Lose uint16 `json:"conn6_lose"` Conn6Tie uint16 `json:"conn6_tie"` // UnusedMind [2]byte /* 舊心情 */ GoWin uint16 `json:"go_win"` GoLose uint16 `json:"go_lose"` GoTie uint16 `json:"go_tie"` DarkWin uint16 `json:"dark_win"` DarkLose uint16 `json:"dark_lose"` DarkTie uint16 `json:"dark_tie"` /* 暗棋戰績 和 */ UaVersion uint8 `json:"ua_version"` Signature uint8 `json:"signature"` /* 慣用簽名檔 */ // Unused10 uint8 /* 從前放好文章數, 使用前請先清0 */ BadPost uint8 `json:"bad_post"` /* 評價為壞文章數 */ MyAngel UUserID `json:"angel"` /* 我的小天使 */ ChessEloRating uint16 `json:"check_rank"` WithMe ptttype.WithMe_t `json:"withme"` TimeRemoveBadPost types.Time4 `json:"time_remove_bad_post"` TimeViolateLaw types.Time4 `json:"time_violate_law"` UserLevel2 ptttype.PERM2 `json:"user_level2"` UpdateTS2 types.Time4 `json:"update_ts2"` }
https://github.com/ptt/pttbbs/blob/master/include/pttstruct.h
func NewUserecFromRaw ¶
func NewUserecFromRaw(userecRaw *ptttype.UserecRaw, userec2Raw *ptttype.Userec2Raw) (user *Userec)
Source Files ¶
- article_id.go
- article_summary.go
- bboard_id.go
- board_detail.go
- board_summary.go
- change_email.go
- change_passwd.go
- check_exists_user.go
- check_passwd.go
- create_article.go
- create_board.go
- create_comment.go
- cross_post.go
- delete_articles.go
- edit_article.go
- errors.go
- get_article.go
- get_favorites.go
- get_post_template.go
- get_user.go
- get_user_visit_count.go
- is_board_valid_user.go
- is_boards_valid_user.go
- is_sysop.go
- is_valid_id_email.go
- load_auto_complete_boards.go
- load_board_detail.go
- load_board_summary.go
- load_boards_by_bids.go
- load_bottom_articles.go
- load_class_boards.go
- load_full_class_boards.go
- load_general_articles.go
- load_general_board_details.go
- load_general_boards.go
- load_hot_boards.go
- login.go
- register.go
- reload_uhash.go
- set_id_email.go
- set_user_perm.go
- userec.go
- uuser_id.go
- write_favorites.go
Click to show internal directories.
Click to hide internal directories.