Documentation ¶
Index ¶
- Constants
- Variables
- func AttemptChangeEmail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func AttemptChangeEmailWrapper(c *gin.Context)
- func AttemptSetIDEmail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func AttemptSetIDEmailWrapper(c *gin.Context)
- func ChangeEmail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func ChangeEmailWrapper(c *gin.Context)
- func ChangePasswd(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func ChangePasswdWrapper(c *gin.Context)
- func CheckExistsUser(remoteAddr string, params interface{}, c *gin.Context) (result interface{}, err error)
- func CheckExistsUserWrapper(c *gin.Context)
- func CreateArticle(remoteAddr string, uuser bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func CreateArticleWrapper(c *gin.Context)
- func CreateBoard(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func CreateBoardWrapper(c *gin.Context)
- func CreateComment(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func CreateCommentWrapper(c *gin.Context)
- func CreateEmailToken(userID bbs.UUserID, clientInfo string, email string, context EmailTokenContext) (raw string, err error)
- func CreateRefreshToken(userID bbs.UUserID, clientInfo string) (raw string, expireTime types.Time4, err error)
- func CreateToken(userID bbs.UUserID, clientInfo string) (raw string, expireTime types.Time4, err error)
- func CrossPost(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func CrossPostWrapper(c *gin.Context)
- func DeleteArticles(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func DeleteArticlesWrapper(c *gin.Context)
- func EditArticle(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func EditArticleWrapper(c *gin.Context)
- func GetArticle(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func GetArticleWrapper(c *gin.Context)
- func GetEmailTokenInfo(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func GetEmailTokenInfoWrapper(c *gin.Context)
- func GetFavorites(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func GetFavoritesWrapper(c *gin.Context)
- func GetJwt(c *gin.Context) (jwt string)
- func GetPostTemplate(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func GetPostTemplateWrapper(c *gin.Context)
- func GetRefreshTokenInfo(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func GetRefreshTokenInfoWrapper(c *gin.Context)
- func GetTokenInfo(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func GetTokenInfoWrapper(c *gin.Context)
- func GetUser(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func GetUserVisitCount(remoteAddr string, params interface{}, c *gin.Context) (interface{}, error)
- func GetUserVisitCountWrapper(c *gin.Context)
- func GetUserWrapper(c *gin.Context)
- func GetVersion(remoteAddr string, params interface{}, c *gin.Context) (interface{}, error)
- func GetVersionWrapper(c *gin.Context)
- func Index(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (interface{}, error)
- func IndexWrapper(c *gin.Context)
- func InitConfig() error
- func IsBoardValidUser(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func IsBoardValidUserWrapper(c *gin.Context)
- func IsBoardsValidUser(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func IsBoardsValidUserWrapper(c *gin.Context)
- func JSON(theFunc APIFunc, params interface{}, c *gin.Context)
- func LoadAutoCompleteBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (interface{}, error)
- func LoadAutoCompleteBoardsWrapper(c *gin.Context)
- func LoadBoardDetail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (ret interface{}, err error)
- func LoadBoardDetailWrapper(c *gin.Context)
- func LoadBoardSummary(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func LoadBoardSummaryWrapper(c *gin.Context)
- func LoadBoardsByBids(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func LoadBoardsByBidsWrapper(c *gin.Context)
- func LoadBottomArticles(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func LoadBottomArticlesWrapper(c *gin.Context)
- func LoadClassBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (ret interface{}, err error)
- func LoadClassBoardsWrapper(c *gin.Context)
- func LoadFullClassBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (ret interface{}, err error)
- func LoadFullClassBoardsWrapper(c *gin.Context)
- func LoadGeneralArticles(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func LoadGeneralArticlesWrapper(c *gin.Context)
- func LoadGeneralBoardDetails(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (interface{}, error)
- func LoadGeneralBoardDetailsWrapper(c *gin.Context)
- func LoadGeneralBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (interface{}, error)
- func LoadGeneralBoardsByClass(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (interface{}, error)
- func LoadGeneralBoardsByClassWrapper(c *gin.Context)
- func LoadGeneralBoardsWrapper(c *gin.Context)
- func LoadHotBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func LoadHotBoardsWrapper(c *gin.Context)
- func Login(remoteAddr string, params interface{}, c *gin.Context) (interface{}, error)
- func LoginRequiredJSON(theFunc LoginRequiredAPIFunc, params interface{}, c *gin.Context)
- func LoginRequiredPathJSON(theFunc LoginRequiredPathAPIFunc, params interface{}, path interface{}, ...)
- func LoginRequiredPathQuery(theFunc LoginRequiredPathAPIFunc, params interface{}, path interface{}, ...)
- func LoginRequiredQuery(theFunc LoginRequiredAPIFunc, params interface{}, c *gin.Context)
- func LoginWrapper(c *gin.Context)
- func OptionsWrapper(c *gin.Context)
- func ParseClaimInt(claim jwt.MapClaims, idx string) (ret int, err error)
- func ParseClaimString(claim jwt.MapClaims, idx string) (ret string, err error)
- func ParseJwt(raw string, secret []byte) (tok *jwt.Token, err error)
- func Query(theFunc APIFunc, params interface{}, c *gin.Context)
- func Refresh(remoteAddr string, params interface{}, c *gin.Context) (result interface{}, err error)
- func RefreshWrapper(c *gin.Context)
- func Register(remoteAddr string, params interface{}, c *gin.Context) (interface{}, error)
- func RegisterWrapper(c *gin.Context)
- func ReloadUHash(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
- func ReloadUHashWrapper(c *gin.Context)
- func SetIDEmail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func SetIDEmailWrapper(c *gin.Context)
- func SetUserPerm(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func SetUserPermWrapper(c *gin.Context)
- func VerifyEmailJwt(raw string, context EmailTokenContext) (userID bbs.UUserID, expireTS int, clientInfo string, email string, err error)
- func VerifyJwt(raw string, isCheckExpire bool) (userID bbs.UUserID, expireTS int, clientInfo string, err error)
- func VerifyRefreshJwt(raw string) (userID bbs.UUserID, expireTS int, clientInfo string, err error)
- func WriteFavorites(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, ...) (result interface{}, err error)
- func WriteFavoritesWrapper(c *gin.Context)
- type APIFunc
- type AttemptChangeEmailParams
- type AttemptChangeEmailPath
- type AttemptChangeEmailResult
- type AttemptSetIDEmailParams
- type AttemptSetIDEmailPath
- type AttemptSetIDEmailResult
- type ChangeEmailParams
- type ChangeEmailPath
- type ChangeEmailResult
- type ChangePasswdParams
- type ChangePasswdPath
- type ChangePasswdResult
- type CheckExistsUserParams
- type CheckExistsUserResult
- type CreateArticleParams
- type CreateArticlePath
- type CreateArticleResult
- type CreateBoardParams
- type CreateBoardPath
- type CreateBoardResult
- type CreateCommentParams
- type CreateCommentPath
- type CreateCommentResult
- type CrossPostParams
- type CrossPostPath
- type CrossPostResult
- type DeleteArticlesParams
- type DeleteArticlesPath
- type DeleteArticlesResult
- type EditArticleParams
- type EditArticlePath
- type EditArticleResult
- type EmailJwtClaim
- type EmailTokenContext
- type GetArticleParams
- type GetArticlePath
- type GetArticleResult
- type GetEmailTokenInfoParams
- type GetEmailTokenInfoResult
- type GetFavoritesParams
- type GetFavoritesPath
- type GetFavoritesResult
- type GetPostTemplateParams
- type GetPostTemplatePath
- type GetPostTemplateResult
- type GetRefreshTokenInfoParams
- type GetRefreshTokenInfoResult
- type GetTokenInfoParams
- type GetTokenInfoResult
- type GetUserParams
- type GetUserPath
- type GetUserResult
- type GetUserVisitCountResult
- type GetVersionResult
- type IndexParams
- type IndexResult
- type IsBoardValidUserPath
- type IsBoardValidUserResult
- type IsBoardsValidUserParams
- type IsBoardsValidUserResult
- type JwtClaim
- type LoadAutoCompleteBoardsParams
- type LoadBoardDetailParams
- type LoadBoardDetailPath
- type LoadBoardDetailResult
- type LoadBoardSummaryParams
- type LoadBoardSummaryPath
- type LoadBoardSummaryResult
- type LoadBoardsByBidsParams
- type LoadBoardsByBidsResult
- type LoadBottomArticlesPath
- type LoadBottomArticlesResult
- type LoadClassBoardsParams
- type LoadClassBoardsPath
- type LoadClassBoardsResult
- type LoadFullClassBoardsParams
- type LoadFullClassBoardsResult
- type LoadGeneralArticlesParams
- type LoadGeneralArticlesPath
- type LoadGeneralArticlesResult
- type LoadGeneralBoardDetailsParams
- type LoadGeneralBoardDetailsResult
- type LoadGeneralBoardsParams
- type LoadGeneralBoardsResult
- type LoadHotBoardsResult
- type LoginParams
- type LoginRequiredAPIFunc
- type LoginRequiredPathAPIFunc
- type LoginResult
- type RefreshJwtClaim
- type RefreshParams
- type RefreshResult
- type RegisterParams
- type RegisterResult
- type ReloadUHashResult
- type SetIDEmailParams
- type SetIDEmailPath
- type SetIDEmailResult
- type SetUserPermParams
- type SetUserPermPath
- type SetUserPermResult
- type WriteFavoritesParams
- type WriteFavoritesPath
- type WriteFavoritesResult
Constants ¶
View Source
const ATTEMPT_CHANGE_EMAIL_R = "/user/:uid/attemptchangeemail"
View Source
const ATTEMPT_SET_ID_EMAIL_R = "/user/:uid/attemptsetidemail"
View Source
const CHANGE_EMAIL_R = "/user/:uid/changeemail"
View Source
const CHANGE_PASSWD_R = "/user/:uid/changepasswd" //nolint
View Source
const CHECK_EXISTS_USER_R = "/existsuser"
View Source
const CREATE_ARTICLE_R = "/board/:bid/article"
View Source
const CREATE_BOARD_R = "/class/:cls/board"
View Source
const CREATE_COMMENT_R = "/board/:bid/article/:aid/comment"
View Source
const CROSS_POST_R = "/board/:bid/article/:aid/crosspost"
View Source
const DELETE_ARTICLES_R = "/board/:bid/deletearticles"
View Source
const EDIT_ARTICLE_R = "/board/:bid/article/:aid/edit"
View Source
const (
EPSILON_EXPIRE_TS = 2
)
View Source
const GET_ARTICLE_R = "/board/:bid/article/:aid"
View Source
const GET_EMAIL_TOKEN_INFO_R = "/emailtoken/info"
View Source
const GET_FAV_R = "/user/:uid/favorites"
View Source
const GET_POST_TEMPLATE_R = "/board/:bid/posttemplate/:tid"
View Source
const GET_REFRESH_TOKEN_INFO_R = "/refreshtoken/info"
View Source
const GET_TOKEN_INFO_R = "/token/info"
View Source
const GET_USER_R = "/user/:uid/information"
View Source
const GET_USER_VISIT_COUNT_R = "/uservisitcount"
View Source
const GET_VERSION_R = "/version"
View Source
const INDEX_R = "/"
View Source
const IS_BOARDS_VALID_USER_R = "/boards/isvalid"
View Source
const IS_BOARD_VALID_USER_R = "/board/:bid/isvalid"
View Source
const LOAD_AUTO_COMPLETE_BOARDS_R = "/boards/autocomplete"
View Source
const LOAD_BOARDS_BY_BIDS_R = "/boards/bybids"
View Source
const LOAD_BOARD_DETAIL_R = "/board/:bid/detail"
View Source
const LOAD_BOARD_SUMMARY_R = "/board/:bid/summary"
View Source
const LOAD_BOTTOM_ARTICLES_R = "/board/:bid/articles/bottom"
View Source
const LOAD_CLASS_BOARDS_R = "/cls/:clsid/boards"
View Source
const LOAD_FULL_CLASS_BOARDS_R = "/cls/boards"
View Source
const LOAD_GENERAL_ARTICLES_R = "/board/:bid/articles"
View Source
const LOAD_GENERAL_BOARDS_BY_CLASS_R = "/boards/byclass"
View Source
const LOAD_GENERAL_BOARDS_R = "/boards"
View Source
const LOAD_GENERAL_BOARD_DETAILS_R = "/boards/detail"
View Source
const LOAD_HOT_BOARDS_R = "/boards/popular"
View Source
const LOGIN_R = "/token"
View Source
const READ_POST_NOTE_R = "/board/:bid/postnote"
View Source
const READ_POST_TYPE_R = "/board/:bid/posttype"
View Source
const REFRESH_R = "/refresh"
View Source
const REGISTER_R = "/register"
View Source
const RELOAD_UHASH_R = "/admin/reloaduhash"
View Source
const SET_ID_EMAIL_R = "/user/:uid/setidemail"
View Source
const SET_USER_PERM_R = "/admin/user/:uid/setperm"
View Source
const WRITE_FAV_R = "/user/:uid/favorites/post"
Variables ¶
View Source
var ( // Creating JWT Token JWT_ISSUER = "go-pttbbs" GUEST = "guest" JWT_SECRET = []byte("jwt_secret") JWT_TOKEN_EXPIRE_TS = 86400 * 1 // 1 days JWT_TOKEN_EXPIRE_DURATION = time.Duration(JWT_TOKEN_EXPIRE_TS) * time.Second EMAIL_JWT_SECRET = []byte("email_jwt_secret") EMAIL_JWT_TOKEN_EXPIRE_TS = 60 * 15 // 15 mins EMAIL_JWT_TOKEN_EXPIRE_DURATION = time.Duration(EMAIL_JWT_TOKEN_EXPIRE_TS) * time.Second REFRESH_JWT_CLAIM_TYPE = "refresh" REFRESH_JWT_SECRET = []byte("refresh_jwt_secret") REFRESH_JWT_TOKEN_EXPIRE_TS = 86400 * 7 // 7 days REFRESH_JWT_TOKEN_EXPIRE_DURATION = time.Duration(REFRESH_JWT_TOKEN_EXPIRE_TS) * time.Second )
View Source
var ( ErrInvalidHost = errors.New("invalid host") ErrInvalidRemoteAddr = errors.New("invalid remote-addr") ErrInvalidParams = errors.New("invalid params") ErrInvalidPath = errors.New("invalid path") ErrLoginFailed = errors.New("login failed") ErrInvalidToken = errors.New("invalid token") ErrInvalidUser = errors.New("invalid user") ErrInvalidIDEmail = errors.New("invalid id email") )
Functions ¶
func AttemptChangeEmail ¶ added in v0.7.0
func AttemptChangeEmailWrapper ¶ added in v0.7.0
func AttemptSetIDEmail ¶ added in v0.8.1
func AttemptSetIDEmailWrapper ¶ added in v0.8.1
func ChangeEmail ¶ added in v0.7.0
func ChangeEmail(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, c *gin.Context) (result interface{}, err error)
ChangeEmail
Sysop initiates only attempt-change-mail. Sysop does not change email directly.
func ChangeEmailWrapper ¶ added in v0.7.0
func ChangePasswd ¶ added in v0.6.0
func ChangePasswdWrapper ¶ added in v0.6.0
func CheckExistsUser ¶ added in v0.9.4
func CheckExistsUserWrapper ¶ added in v0.9.4
func CreateArticle ¶ added in v0.12.0
func CreateArticleWrapper ¶ added in v0.12.0
func CreateBoard ¶ added in v0.11.1
func CreateBoardWrapper ¶ added in v0.11.1
func CreateComment ¶ added in v0.14.0
func CreateCommentWrapper ¶ added in v0.14.0
func CreateEmailToken ¶ added in v0.7.3
func CreateRefreshToken ¶ added in v0.24.0
func CreateToken ¶ added in v0.7.3
func CrossPostWrapper ¶ added in v0.16.0
func DeleteArticles ¶ added in v0.19.0
func DeleteArticlesWrapper ¶ added in v0.19.0
func EditArticle ¶ added in v0.18.0
func EditArticleWrapper ¶ added in v0.18.0
func GetArticle ¶ added in v0.4.0
func GetArticle(remoteAddr string, uuserID bbs.UUserID, params interface{}, path interface{}, c *gin.Context) (result interface{}, err error)
GetArticle
Require middleware to handle deleted files (by owner-name and by title). We will handle user-board relation and filename prefix.
Require middleware to parse the content. Require middleware to take care of user-read-article.
func GetArticleWrapper ¶ added in v0.4.4
func GetEmailTokenInfo ¶ added in v0.7.3
func GetEmailTokenInfoWrapper ¶ added in v0.7.3
func GetFavorites ¶ added in v0.9.0
func GetFavoritesWrapper ¶ added in v0.9.0
func GetPostTemplate ¶ added in v0.23.3
func GetPostTemplateWrapper ¶ added in v0.23.3
func GetRefreshTokenInfo ¶ added in v0.24.0
func GetRefreshTokenInfoWrapper ¶ added in v0.24.0
func GetTokenInfo ¶ added in v0.7.3
func GetTokenInfoWrapper ¶ added in v0.7.3
func GetUserVisitCount ¶ added in v0.19.2
func GetUserVisitCountWrapper ¶ added in v0.19.2
func GetUserWrapper ¶ added in v0.5.0
func GetVersion ¶ added in v0.12.3
func GetVersionWrapper ¶ added in v0.12.3
func IndexWrapper ¶ added in v0.4.4
func InitConfig ¶
func InitConfig() error
func IsBoardValidUser ¶ added in v0.9.5
func IsBoardValidUserWrapper ¶ added in v0.9.5
func IsBoardsValidUser ¶ added in v0.17.0
func IsBoardsValidUserWrapper ¶ added in v0.17.0
func LoadAutoCompleteBoards ¶ added in v0.10.0
func LoadAutoCompleteBoardsWrapper ¶ added in v0.10.0
func LoadBoardDetail ¶ added in v0.18.0
func LoadBoardDetailWrapper ¶ added in v0.18.0
func LoadBoardSummary ¶ added in v0.8.0
func LoadBoardSummaryWrapper ¶ added in v0.8.0
func LoadBoardsByBids ¶ added in v0.9.2
func LoadBoardsByBidsWrapper ¶ added in v0.9.2
func LoadBottomArticles ¶ added in v0.15.0
func LoadBottomArticlesWrapper ¶ added in v0.15.0
func LoadClassBoards ¶ added in v0.17.0
func LoadClassBoardsWrapper ¶ added in v0.17.0
func LoadFullClassBoards ¶ added in v0.17.0
func LoadFullClassBoardsWrapper ¶ added in v0.17.0
func LoadGeneralArticles ¶ added in v0.3.0
func LoadGeneralArticlesWrapper ¶ added in v0.4.4
func LoadGeneralBoardDetails ¶ added in v0.23.0
func LoadGeneralBoardDetailsWrapper ¶ added in v0.23.0
func LoadGeneralBoards ¶ added in v0.2.3
func LoadGeneralBoardsByClass ¶ added in v0.9.0
func LoadGeneralBoardsByClassWrapper ¶ added in v0.9.0
func LoadGeneralBoardsWrapper ¶ added in v0.4.4
func LoadHotBoards ¶ added in v0.9.0
func LoadHotBoards(remoteAddr string, uuserID bbs.UUserID, params interface{}, c *gin.Context) (result interface{}, err error)
We have only 128 hot-boards.
func LoadHotBoardsWrapper ¶ added in v0.9.0
func LoginRequiredJSON ¶ added in v0.4.4
func LoginRequiredJSON(theFunc LoginRequiredAPIFunc, params interface{}, c *gin.Context)
func LoginRequiredPathJSON ¶ added in v0.4.4
func LoginRequiredPathJSON(theFunc LoginRequiredPathAPIFunc, params interface{}, path interface{}, c *gin.Context)
func LoginRequiredPathQuery ¶ added in v0.4.4
func LoginRequiredPathQuery(theFunc LoginRequiredPathAPIFunc, params interface{}, path interface{}, c *gin.Context)
func LoginRequiredQuery ¶ added in v0.4.4
func LoginRequiredQuery(theFunc LoginRequiredAPIFunc, params interface{}, c *gin.Context)
func LoginWrapper ¶ added in v0.4.4
func OptionsWrapper ¶ added in v0.9.8
func ParseClaimInt ¶ added in v0.15.2
func ParseClaimString ¶ added in v0.15.2
func RefreshWrapper ¶ added in v0.24.0
func RegisterWrapper ¶ added in v0.4.4
func ReloadUHash ¶ added in v0.13.0
func ReloadUHashWrapper ¶ added in v0.13.0
func SetIDEmail ¶ added in v0.7.1
func SetIDEmailWrapper ¶ added in v0.7.1
func SetUserPerm ¶ added in v0.13.1
func SetUserPermWrapper ¶ added in v0.13.1
func VerifyEmailJwt ¶ added in v0.7.0
func VerifyRefreshJwt ¶ added in v0.24.0
func WriteFavorites ¶ added in v0.23.6
func WriteFavoritesWrapper ¶ added in v0.23.6
Types ¶
type AttemptChangeEmailParams ¶ added in v0.7.0
type AttemptChangeEmailPath ¶ added in v0.7.0
type AttemptChangeEmailResult ¶ added in v0.7.0
type AttemptSetIDEmailParams ¶ added in v0.8.1
type AttemptSetIDEmailPath ¶ added in v0.8.1
type AttemptSetIDEmailResult ¶ added in v0.8.1
type ChangeEmailParams ¶ added in v0.7.0
type ChangeEmailParams struct {
Jwt string `json:"email_token"`
}
type ChangeEmailPath ¶ added in v0.7.0
type ChangeEmailResult ¶ added in v0.7.0
type ChangePasswdParams ¶ added in v0.6.0
type ChangePasswdPath ¶ added in v0.6.0
type ChangePasswdResult ¶ added in v0.6.0
type ChangePasswdResult LoginResult
type CheckExistsUserParams ¶ added in v0.9.4
type CheckExistsUserParams struct {
Username string `json:"username"`
}
type CheckExistsUserResult ¶ added in v0.9.4
type CreateArticleParams ¶ added in v0.12.0
type CreateArticlePath ¶ added in v0.12.0
type CreateArticleResult ¶ added in v0.12.0
type CreateArticleResult *bbs.ArticleSummary
type CreateBoardParams ¶ added in v0.11.1
type CreateBoardParams struct { Brdname string `json:"brdname" form:"brdname" url:"brdname"` BrdClass []byte `json:"class" form:"class" url:"class"` BrdTitle []byte `json:"title" form:"title" url:"title"` BMs []bbs.UUserID `json:"bms" form:"bms" url:"bms"` BrdAttr ptttype.BrdAttr `json:"brdattr" form:"brdattr" url:"brdattr"` Level ptttype.PERM `json:"level,omitempty" form:"level,omitempty" url:"level,omitempty"` ChessCountry ptttype.ChessCode `json:"chess_country,omitempty" form:"chess_country,omitempty" url:"chess_country,omitempty"` IsGroup bool `json:"is_group" form:"is_group" url:"is_group"` }
type CreateBoardPath ¶ added in v0.11.1
type CreateBoardResult ¶ added in v0.11.1
type CreateBoardResult *bbs.BoardSummary
type CreateCommentParams ¶ added in v0.14.0
type CreateCommentParams struct { CommentType ptttype.CommentType `json:"type" form:"type" url:"type"` Content []byte `json:"content" form:"content" url:"content"` }
type CreateCommentPath ¶ added in v0.14.0
type CreateCommentResult ¶ added in v0.14.0
type CrossPostParams ¶ added in v0.16.0
type CrossPostPath ¶ added in v0.16.0
type CrossPostResult ¶ added in v0.16.0
type CrossPostResult struct { // bbs.ArticleSummary ArticleSummary *bbs.ArticleSummary `json:"article"` Comment []byte `json:"comment"` CommentMTime types.Time4 `json:"comment_mtime"` }
type DeleteArticlesParams ¶ added in v0.19.0
type DeleteArticlesPath ¶ added in v0.19.0
type DeleteArticlesResult ¶ added in v0.19.0
type EditArticleParams ¶ added in v0.18.0
type EditArticleParams struct { PostType []byte `json:"class" form:"class" url:"class"` Title []byte `json:"title,omitempty" form:"title,omitempty" url:"title,omitempty"` Content [][]byte `json:"content" form:"content" url:"content"` OldSZ int `json:"oldsz" form:"oldsz" url:"oldsz"` OldSum cmsys.Fnv64_t `json:"oldsum" form:"oldsum" url:"oldsum"` }
type EditArticlePath ¶ added in v0.18.0
type EditArticleResult ¶ added in v0.18.0
type EmailJwtClaim ¶ added in v0.7.0
type EmailTokenContext ¶ added in v0.8.1
type EmailTokenContext string
const ( CONTEXT_CHANGE_EMAIL EmailTokenContext = "email" CONTEXT_SET_ID_EMAIL EmailTokenContext = "id_email" )
type GetArticleParams ¶ added in v0.4.0
type GetArticlePath ¶ added in v0.4.0
type GetArticleResult ¶ added in v0.4.0
type GetEmailTokenInfoParams ¶ added in v0.7.3
type GetEmailTokenInfoParams struct { Jwt string `json:"token" form:"token" url:"token"` Context EmailTokenContext `json:"context" form:"context" url:"context"` }
type GetEmailTokenInfoResult ¶ added in v0.7.3
type GetFavoritesParams ¶ added in v0.9.0
type GetFavoritesPath ¶ added in v0.9.0
type GetFavoritesResult ¶ added in v0.9.0
type GetPostTemplateParams ¶ added in v0.23.3
type GetPostTemplateParams struct { RetrieveTS types.Time4 `json:"last_ts,omitempty" form:"last_ts,omitempty" url:"last_ts,omitempty"` IsSystem bool `json:"system,omitempty" form:"system,omitempty" url:"system,omitempty"` IsHash bool `json:"hash,omitempty" form:"hash,omitempty" url:"hash,omitempty"` }
type GetPostTemplatePath ¶ added in v0.23.3
type GetPostTemplateResult ¶ added in v0.23.3
type GetRefreshTokenInfoParams ¶ added in v0.24.0
type GetRefreshTokenInfoParams struct {
Jwt string `json:"token" form:"token" url:"token"`
}
type GetRefreshTokenInfoResult ¶ added in v0.24.0
type GetTokenInfoParams ¶ added in v0.7.3
type GetTokenInfoParams struct {
Jwt string `json:"token" form:"token" url:"token"`
}
type GetTokenInfoResult ¶ added in v0.7.3
type GetUserParams ¶ added in v0.5.0
type GetUserParams struct{}
type GetUserPath ¶ added in v0.5.0
type GetUserResult ¶ added in v0.5.0
type GetUserVisitCountResult ¶ added in v0.19.2
type GetUserVisitCountResult struct {
Total int32 `json:"total"`
}
type GetVersionResult ¶ added in v0.12.3
type IndexParams ¶
type IndexParams struct{}
type IndexResult ¶
type IndexResult struct {
Data string
}
type IsBoardValidUserPath ¶ added in v0.9.5
type IsBoardValidUserResult ¶ added in v0.9.5
type IsBoardValidUserResult struct {
IsValid bool `json:"is_valid"`
}
type IsBoardsValidUserParams ¶ added in v0.17.0
type IsBoardsValidUserResult ¶ added in v0.17.0
type LoadAutoCompleteBoardsParams ¶ added in v0.10.0
type LoadAutoCompleteBoardsParams struct { StartIdx string `json:"start_idx,omitempty" form:"start_idx,omitempty" url:"start_idx,omitempty"` NBoards int `json:"max,omitempty" form:"max,omitempty" url:"max,omitempty"` Keyword string `json:"brdname,omitempty" form:"brdname,omitempty" url:"brdname,omitempty"` Asc bool `json:"asc,omitempty" form:"asc,omitempty" url:"asc,omitempty"` }
type LoadBoardDetailParams ¶ added in v0.18.0
type LoadBoardDetailParams struct{}
type LoadBoardDetailPath ¶ added in v0.18.0
type LoadBoardDetailResult ¶ added in v0.18.0
type LoadBoardDetailResult *bbs.BoardDetail
XXX LoadBoardDetailResult is a pointer
It's possible that this is unavoidable, and we need to change all the result-type to be pointer-based.
type LoadBoardSummaryParams ¶ added in v0.8.0
type LoadBoardSummaryParams struct{}
type LoadBoardSummaryPath ¶ added in v0.8.0
type LoadBoardSummaryResult ¶ added in v0.8.0
type LoadBoardSummaryResult *bbs.BoardSummary
XXX LoadBoardSummaryResult is a pointer
It's possible that this is unavoidable, and we need to change all the result-type to be pointer-based.
type LoadBoardsByBidsParams ¶ added in v0.9.2
type LoadBoardsByBidsResult ¶ added in v0.9.2
type LoadBoardsByBidsResult struct {
Boards []*bbs.BoardSummary `json:"data"`
}
type LoadBottomArticlesPath ¶ added in v0.15.0
type LoadBottomArticlesResult ¶ added in v0.15.0
type LoadBottomArticlesResult struct {
Articles []*bbs.ArticleSummary `json:"data"`
}
type LoadClassBoardsParams ¶ added in v0.17.0
type LoadClassBoardsPath ¶ added in v0.17.0
type LoadClassBoardsResult ¶ added in v0.17.0
type LoadClassBoardsResult struct {
Boards []*bbs.BoardSummary `json:"data"`
}
type LoadFullClassBoardsParams ¶ added in v0.17.0
type LoadFullClassBoardsResult ¶ added in v0.17.0
type LoadFullClassBoardsResult struct { Boards []*bbs.BoardSummary `json:"data"` NextBid ptttype.Bid `json:"next_bid"` }
type LoadGeneralArticlesParams ¶ added in v0.3.0
type LoadGeneralArticlesParams struct { StartIdx string `json:"start_idx,omitempty" form:"start_idx,omitempty" url:"start_idx,omitempty"` NArticles int `json:"max" form:"max" url:"max"` Desc bool `json:"desc,omitempty" form:"desc,omitempty" url:"desc"` IsSystem bool `json:"system,omitempty" form:"system,omitempty" url:"system"` }
func NewLoadGeneralArticlesParams ¶ added in v0.10.0
func NewLoadGeneralArticlesParams() *LoadGeneralArticlesParams
type LoadGeneralArticlesPath ¶ added in v0.3.0
type LoadGeneralArticlesResult ¶ added in v0.3.0
type LoadGeneralBoardDetailsParams ¶ added in v0.23.0
type LoadGeneralBoardDetailsParams struct { StartIdx string `json:"start_idx,omitempty" form:"start_idx,omitempty" url:"start_idx,omitempty"` NBoards int `json:"max" form:"max" url:"max"` Asc bool `json:"asc,omitempty" form:"asc,omitempty" url:"asc"` IsSystem bool `json:"system,omitempty" form:"system,omitempty" url:"system"` }
func NewLoadGeneralBoardDetailsParams ¶ added in v0.23.0
func NewLoadGeneralBoardDetailsParams() *LoadGeneralBoardDetailsParams
type LoadGeneralBoardDetailsResult ¶ added in v0.23.0
type LoadGeneralBoardDetailsResult struct { Boards []*bbs.BoardDetail `json:"data"` NextIdx string `json:"next_idx"` }
type LoadGeneralBoardsParams ¶ added in v0.2.3
type LoadGeneralBoardsParams struct { StartIdx string `json:"start_idx,omitempty" form:"start_idx,omitempty" url:"start_idx,omitempty"` NBoards int `json:"max" form:"max" url:"max"` Title []byte `json:"title,omitempty" form:"title,omitempty" url:"title,omitempty"` // sending utf8-bytes from middleware Keyword []byte `json:"keyword,omitempty" form:"keyword,omitempty" url:"keyword,omitempty"` // sending utf8-bytes from middleware Asc bool `json:"asc,omitempty" form:"asc,omitempty" url:"asc"` IsSystem bool `json:"system,omitempty" form:"system,omitempty" url:"system"` }
func NewLoadGeneralBoardsParams ¶ added in v0.11.1
func NewLoadGeneralBoardsParams() *LoadGeneralBoardsParams
type LoadGeneralBoardsResult ¶ added in v0.2.3
type LoadGeneralBoardsResult struct { Boards []*bbs.BoardSummary `json:"data"` NextIdx string `json:"next_idx"` }
type LoadHotBoardsResult ¶ added in v0.9.3
type LoadHotBoardsResult struct {
Boards []*bbs.BoardSummary `json:"data"`
}
type LoginParams ¶ added in v0.2.3
type LoginRequiredAPIFunc ¶ added in v0.15.2
type LoginRequiredPathAPIFunc ¶ added in v0.15.2
type LoginResult ¶ added in v0.2.3
type RefreshJwtClaim ¶ added in v0.24.0
type RefreshParams ¶ added in v0.24.0
type RefreshResult ¶ added in v0.24.0
type RefreshResult LoginResult
type RegisterParams ¶ added in v0.2.3
type RegisterParams struct { ClientInfo string `json:"client_info"` Username string `json:"username"` Passwd string `json:"password"` Email string `json:"email,omitempty"` Nickname []byte `json:"nickname,omitempty"` // sending utf8-bytes from middleware. Realname []byte `json:"realname,omitempty"` Career []byte `json:"career,omitempty"` Address []byte `json:"address,omitempty"` Over18 bool `json:"over18"` }
type RegisterResult ¶ added in v0.2.3
type RegisterResult LoginResult
type ReloadUHashResult ¶ added in v0.13.0
type ReloadUHashResult struct {
Success bool `json:"success"`
}
type SetIDEmailParams ¶ added in v0.7.1
type SetIDEmailPath ¶ added in v0.7.1
type SetIDEmailResult ¶ added in v0.7.1
type SetUserPermParams ¶ added in v0.13.1
type SetUserPermPath ¶ added in v0.13.1
type SetUserPermResult ¶ added in v0.13.1
type WriteFavoritesParams ¶ added in v0.23.6
type WriteFavoritesParams struct {
Content []byte `json:"content,omitempty" form:"content,omitempty" url:"content,omitempty"`
}
type WriteFavoritesPath ¶ added in v0.23.6
type WriteFavoritesResult ¶ added in v0.23.6
Source Files ¶
- 00-config.go
- api.go
- api_login_required.go
- api_login_required_path.go
- api_utils.go
- attempt_change_email.go
- attempt_set_id_email.go
- auth_utils.go
- change_email.go
- change_passwd.go
- check_exists_user.go
- config.go
- config_util.go
- const.go
- create_article.go
- create_board.go
- create_comment.go
- cross_post.go
- delete_articles.go
- edit_article.go
- email_token_context.go
- errors.go
- get_article.go
- get_email_token_info.go
- get_favorites.go
- get_post_template.go
- get_refresh_token_info.go
- get_token_info.go
- get_user.go
- get_user_visit_count.go
- get_version.go
- index.go
- is_board_valid_user.go
- is_boards_valid_user.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_general_boards_by_class.go
- load_hot_boards.go
- login.go
- options.go
- read_post_note.go
- read_post_type.go
- refresh.go
- register.go
- reload_uhash.go
- set_id_email.go
- set_user_perm.go
- types.go
- user_utils.go
- validate_host.go
- validate_remote_addr.go
- write_favorites.go
Click to show internal directories.
Click to hide internal directories.