aiotieba

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Unlicense Imports: 114 Imported by: 0

README

aiotieba-go

Go Reference Release Go Version License

一个用 Go 编写的百度贴吧 API 库,是原 Python 版 aiotieba 的全量移植。

Client 暴露与 Python 版同名(PascalCase)的方法,覆盖 HTTP、WebSocket、BLCP 私有协议、贴吧客户端签名与 AES 等加密、以及 protobuf 编解码。

安装

go get github.com/rongyuio/aiotieba-go

认证

调用前需要准备两个登录凭证:

凭证 长度 说明
BDUSS 192 字符 用户身份认证 token,必填
STOKEN 64 字符 额外的安全 token,部分 API 需要,可留空

快速开始

package main

import (
	"context"
	"fmt"

	"github.com/rongyuio/aiotieba-go"
)

func main() {
	client, err := aiotieba.New("你的BDUSS", "你的STOKEN")
	if err != nil {
		panic(err)
	}
	defer client.Close()

	threads, err := client.GetThreads(context.Background(), "天堂鸡汤", aiotieba.GetThreadsArgs{Pn: 1, Rn: 30})
	if err != nil {
		panic(err)
	}
	for _, thread := range threads.Objs {
		fmt.Printf("tid=%d\n%s\n", thread.Tid, thread.Text())
	}
}

API 列表

方法名与 Python 版一一对齐(PascalCase),内部统一采用 context.Context 与显式 error 返回。完整签名见 Go Reference。

帖子与回复

GetThreads GetPosts GetComments GetLastReplyers AddPost DelPost DelPosts DelThread DelThreads HideThread UnhideThread Recover GetRecovers Good Ungood Top Untop Move SetThreadPrivate SetThreadPublic Recommend Disagree Unagree Undisagree AddPoll

用户

GetUserInfo GetSelfInfo GetHomepage GetFans GetFollows FollowUser UnfollowUser RemoveFan GetUserPosts GetUserThreads GetSelfPosts GetSelfThreads TiebaUID2UserInfo GetPortrait GetImage Hash2Image

吧(论坛)

GetForum GetForumDetail GetFID GetFName GetFollowForums GetSelfFollowForums FollowForum UnfollowForum GetSquareForums GetRankForums GetRankUsers DislikeForum UndislikeForum GetDislikeForums

吧务管理

GetBawuInfo GetBawuMemberlist GetBawuPerm SetBawuPerm AddBawu DelBawu GetBawuPostlogs GetBawuUserlogs Block Unblock GetBlocks GetUnblockAppeals SetBlacklist GetBlacklist GetBlacklistOld AddBawuBlacklist DelBawuBlacklist GetBawuBlacklist

消息与聊天

SendMsg GetGroupMsg SetMsgReaded SendChatroomMsg JoinChatroom GetAts GetReplys

签到

SignForum SignForums SignGrowth

搜索

SearchExact SearchGlobal

其他

Login GetStatistics GetTabMap GetCID GetRecomStatus GetUserForumInfo GetMemberUsers SetProfile SetNicknameOld

项目特色

  • 收录数十个常用 API(api/ 目录下每个子包对应一个贴吧接口)
  • 支持 protobuf 序列化请求参数
  • 支持 WebSocket 接口与 BLCP 群聊协议
  • 与官方版本高度一致的密码学实现(签名、cuid_galaxy2、c3_aid、rc4_42、AES-ECB/CBC 等,均有逐字节测试向量)
  • 全量对照原 Python 版迁移,公开方法名对齐,内部采用 Go 惯用法(context.Context、显式 error 返回、结构体)

目录结构

aiotieba-go/
├── client.go          # Client 门面:聚合全部 API 方法
├── config/ consts/ enums/ exception/ logging/   # 配置 / 常量 / 枚举 / 异常 / 日志
├── core/              # Account / NetCore / HttpCore / WsCore / BLCPCore
├── helper/            # utils / cache / crypto / htmlutil
├── protobuf/          # 通用 protobuf 生成代码
├── api/               # 约 100 个 API 子包(每个含 api.go / classdef.go / protobuf)
└── tools/genproto/    # protoc-gen-go 生成脚本

Documentation

Overview

Package aiotieba is a Go port of the aiotieba library: an asynchronous client for the Baidu Tieba APIs.

The public method names follow the Python client (aiotieba.client.Client) so that both implementations can be compared side by side, while the internals use idiomatic Go: context.Context, explicit error returns and structs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the entry point of the library. It mirrors aiotieba.client.Client.

func New

func New(bduss, stoken string, opts ...Option) (*Client, error)

New creates a client.

BDUSS must be empty or 192 characters long and STOKEN must be empty or 64 characters long, like the Python constructor.

func (*Client) Account

func (c *Client) Account() *core.Account

Account returns the account of the client.

func (*Client) AddBawu

func (c *Client) AddBawu(ctx context.Context, ref ForumRef, id UserRef, bawuType enums.BawuType) (exception.BoolResponse, error)

AddBawu adds a moderator to a forum, mirroring Client.add_bawu.

func (*Client) AddBawuBlacklist

func (c *Client) AddBawuBlacklist(ctx context.Context, ref ForumRef, id UserRef) (exception.BoolResponse, error)

AddBawuBlacklist adds a user to the forum blacklist, mirroring Client.add_bawu_blacklist.

func (*Client) AddBlacklistOld

func (c *Client) AddBlacklistOld(ctx context.Context, id UserRef) (exception.BoolResponse, error)

AddBlacklistOld adds a user to the legacy user blacklist, mirroring Client.add_blacklist_old.

func (*Client) AddPoll

func (c *Client) AddPoll(ctx context.Context, tid int64, options []int64) (exception.BoolResponse, error)

AddPoll casts a vote, mirroring Client.add_poll.

func (*Client) AddPost

func (c *Client) AddPost(ctx context.Context, ref ForumRef, tid int64, content string) (exception.BoolResponse, error)

AddPost replies to a thread, mirroring Client.add_post.

Posting is a high-risk operation on the Tieba platform: calling it too frequently may lead to a permanent ban. Use with caution.

func (*Client) Agree

func (c *Client) Agree(ctx context.Context, tid, pid int64, isComment bool) (exception.BoolResponse, error)

Agree likes a thread or a reply, mirroring Client.agree.

func (*Client) BLCPCore

func (c *Client) BLCPCore() *core.BLCPCore

BLCPCore exposes the BLCP session of the client.

func (*Client) Block

func (c *Client) Block(ctx context.Context, ref ForumRef, id UserRef, day int64, reason string) (exception.BoolResponse, error)

Block bans a user from a forum, mirroring Client.block.

func (*Client) Close

func (c *Client) Close() error

Close releases the network resources of the client. It mirrors __aexit__.

func (*Client) DelBawu

func (c *Client) DelBawu(ctx context.Context, ref ForumRef, id UserRef, bawuType enums.BawuType) (exception.BoolResponse, error)

DelBawu removes a moderator from a forum, mirroring Client.del_bawu.

func (*Client) DelBawuBlacklist

func (c *Client) DelBawuBlacklist(ctx context.Context, ref ForumRef, id UserRef) (exception.BoolResponse, error)

DelBawuBlacklist removes a user from the forum blacklist, mirroring Client.del_bawu_blacklist.

func (*Client) DelBlacklistOld

func (c *Client) DelBlacklistOld(ctx context.Context, id UserRef) (exception.BoolResponse, error)

DelBlacklistOld removes a user from the legacy user blacklist, mirroring Client.del_blacklist_old.

func (*Client) DelPost

func (c *Client) DelPost(ctx context.Context, ref ForumRef, tid, pid int64) (exception.BoolResponse, error)

DelPost removes a reply, mirroring Client.del_post.

func (*Client) DelPosts

func (c *Client) DelPosts(ctx context.Context, ref ForumRef, tid int64, pids []int64, block bool) (exception.BoolResponse, error)

DelPosts removes several replies, mirroring Client.del_posts.

func (*Client) DelThread

func (c *Client) DelThread(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

DelThread removes a thread, mirroring Client.del_thread.

func (*Client) DelThreads

func (c *Client) DelThreads(ctx context.Context, ref ForumRef, tids []int64, block bool) (exception.BoolResponse, error)

DelThreads removes several threads, mirroring Client.del_threads.

func (*Client) Disagree

func (c *Client) Disagree(ctx context.Context, tid, pid int64, isComment bool) (exception.BoolResponse, error)

Disagree dislikes a thread or reply, mirroring Client.disagree.

func (*Client) DislikeForum

func (c *Client) DislikeForum(ctx context.Context, ref ForumRef) (exception.BoolResponse, error)

DislikeForum hides a forum from the home page recommendations, mirroring Client.dislike_forum.

func (*Client) FollowForum

func (c *Client) FollowForum(ctx context.Context, ref ForumRef) (exception.BoolResponse, error)

FollowForum follows a forum, mirroring Client.follow_forum.

func (*Client) FollowUser

func (c *Client) FollowUser(ctx context.Context, id UserRef) (exception.BoolResponse, error)

FollowUser follows a user, mirroring Client.follow_user.

func (*Client) GetAts

func (c *Client) GetAts(ctx context.Context, pn int64) (getats.Ats, error)

GetAts returns the @ notifications of the account, mirroring Client.get_ats.

func (*Client) GetBawuBlacklist

func (c *Client) GetBawuBlacklist(ctx context.Context, ref ForumRef, pn int64) (getbawublacklist.BawuBlacklistUsers, error)

GetBawuBlacklist returns the forum-backend blacklist, mirroring Client.get_bawu_blacklist.

func (*Client) GetBawuInfo

func (c *Client) GetBawuInfo(ctx context.Context, ref ForumRef) (getbawuinfo.BawuInfo, error)

GetBawuInfo returns the moderator team of a forum, mirroring Client.get_bawu_info.

func (*Client) GetBawuMemberlist

func (c *Client) GetBawuMemberlist(ctx context.Context, ref ForumRef, pn int64, searchValue string) (getbawumemberlist.BawuListMemberUsers, error)

GetBawuMemberlist returns the member list of a forum, mirroring Client.get_bawu_memberlist.

func (*Client) GetBawuPerm

func (c *Client) GetBawuPerm(ctx context.Context, ref ForumRef, id UserRef) (getbawuperm.BawuPerm, error)

GetBawuPerm returns the permissions assigned to a moderator, mirroring Client.get_bawu_perm.

func (*Client) GetBawuPostlogs

func (c *Client) GetBawuPostlogs(
	ctx context.Context, ref ForumRef, pn int64, searchValue string, searchType enums.BawuSearchType,
	startDT, endDT *time.Time, opType int64,
) (getbawupostlogs.BawuPostLogs, error)

GetBawuPostlogs returns the post-management logs, mirroring Client.get_bawu_postlogs.

func (*Client) GetBawuUserlogs

func (c *Client) GetBawuUserlogs(
	ctx context.Context, ref ForumRef, pn int64, searchValue string, searchType enums.BawuSearchType,
	startDT, endDT *time.Time, opType int64,
) (getbawuuserlogs.BawuUserLogs, error)

GetBawuUserlogs returns the user-management logs, mirroring Client.get_bawu_userlogs.

func (*Client) GetBlacklist

func (c *Client) GetBlacklist(ctx context.Context) (getblacklist.BlacklistUsers, error)

GetBlacklist returns the new-style user blacklist, mirroring Client.get_blacklist.

func (*Client) GetBlacklistOld

func (c *Client) GetBlacklistOld(ctx context.Context, pn, rn int32) (getblacklistold.BlacklistOldUsers, error)

GetBlacklistOld returns the legacy user blacklist, mirroring Client.get_blacklist_old.

func (*Client) GetBlocks

func (c *Client) GetBlocks(ctx context.Context, ref ForumRef, name string, pn int64) (getblocks.Blocks, error)

GetBlocks returns the blocked users pending unblock, mirroring Client.get_blocks.

func (*Client) GetCID

func (c *Client) GetCID(ctx context.Context, ref ForumRef, cname string) (exception.IntResponse, error)

GetCID returns the id of a good category, mirroring Client.get_cid.

func (*Client) GetComments

func (c *Client) GetComments(ctx context.Context, tid, pid int64, args GetCommentsArgs) (getcomments.Comments, error)

GetComments returns the comments of a floor, mirroring Client.get_comments.

func (*Client) GetDislikeForums

func (c *Client) GetDislikeForums(ctx context.Context, pn, rn int32) (getdislikeforums.DislikeForums, error)

GetDislikeForums returns the forums hidden from the home page recommendations, mirroring Client.get_dislike_forums.

func (*Client) GetFID

func (c *Client) GetFID(ctx context.Context, fname string) (int64, error)

GetFID resolves a forum name to its fid, using the forum cache first. It mirrors Client.get_fid.

func (*Client) GetFName

func (c *Client) GetFName(ctx context.Context, fid int64) (string, error)

GetFName resolves a fid to its forum name, using the forum cache first. It mirrors Client.get_fname.

func (*Client) GetFans

func (c *Client) GetFans(ctx context.Context, id UserRef, pn int64) (getfans.Fans, error)

GetFans returns the fans of a user, mirroring Client.get_fans. An empty id refers to the account itself.

func (*Client) GetFollowForums

func (c *Client) GetFollowForums(ctx context.Context, id UserRef, pn, rn int64) (getfollowforums.FollowForums, error)

GetFollowForums returns the forums followed by a user, mirroring Client.get_follow_forums.

func (*Client) GetFollowForumsPc

func (c *Client) GetFollowForumsPc(ctx context.Context, id UserRef, pn, rn int64) (getfollowforumspc.PcFollowForums, error)

GetFollowForumsPc returns the forums followed by a user, mirroring Client.get_follow_forums_pc.

func (*Client) GetFollows

func (c *Client) GetFollows(ctx context.Context, id UserRef, pn int64) (getfollows.Follows, error)

GetFollows returns the follow list of a user, mirroring Client.get_follows. An empty id refers to the account itself.

func (*Client) GetForum

func (c *Client) GetForum(ctx context.Context, ref ForumRef) (getforum.Forum, error)

GetForum returns the information of a forum, mirroring Client.get_forum.

func (*Client) GetForumDetail

func (c *Client) GetForumDetail(ctx context.Context, ref ForumRef) (getforumdetail.ForumDetail, error)

GetForumDetail returns the information of a forum, mirroring Client.get_forum_detail.

func (*Client) GetGroupMsg

func (c *Client) GetGroupMsg(ctx context.Context, groupIDs []int64, getType int64) (getgroupmsg.WsMsgGroups, error)

GetGroupMsg returns the messages of the given websocket groups, mirroring Client.get_group_msg.

The API is only available over the websocket transport, so a connection is established unconditionally (the _force_websocket decorator of the Python client) and its failure is reported to the caller.

func (*Client) GetHomepage

func (c *Client) GetHomepage(ctx context.Context, id UserRef, pn int32) (profile.Homepage, error)

GetHomepage returns the posts of a user home page, mirroring Client.get_homepage.

func (*Client) GetImage

func (c *Client) GetImage(ctx context.Context, imgURL string) (getimages.Image, error)

GetImage fetches and decodes a static image, mirroring Client.get_image.

func (*Client) GetImageBytes

func (c *Client) GetImageBytes(ctx context.Context, imgURL string) (getimages.ImageBytes, error)

GetImageBytes fetches the raw bytes of a static image, mirroring Client.get_image_bytes.

func (*Client) GetLastReplyers

func (c *Client) GetLastReplyers(ctx context.Context, ref ForumRef, pn, rn int32, sort enums.ThreadSortType, isGood bool) (getlastreplyers.ThreadsLP, error)

GetLastReplyers returns the threads of a forum together with their last replier, mirroring Client.get_last_replyers.

The legacy endpoint is mainly used to detect thread necromancy and does not expose the full thread information.

func (*Client) GetMemberUsers

func (c *Client) GetMemberUsers(ctx context.Context, ref ForumRef, pn int64) (getmemberusers.MemberUsers, error)

GetMemberUsers returns the latest members of a forum, mirroring Client.get_member_users.

func (*Client) GetPortrait

func (c *Client) GetPortrait(ctx context.Context, id UserRef, size string) (getimages.Image, error)

GetPortrait fetches the portrait image of a user, mirroring Client.get_portrait.

func (*Client) GetPosts

func (c *Client) GetPosts(ctx context.Context, tid int64, args GetPostsArgs) (getposts.Posts, error)

GetPosts returns the floors of a thread, mirroring Client.get_posts.

func (*Client) GetRankForums

func (c *Client) GetRankForums(ctx context.Context, ref ForumRef, pn int64, rankType enums.RankForumType) (getrankforums.RankForums, error)

GetRankForums returns the sign-in ranking of forums, mirroring Client.get_rank_forums.

func (*Client) GetRankUsers

func (c *Client) GetRankUsers(ctx context.Context, ref ForumRef, pn int64) (getrankusers.RankUsers, error)

GetRankUsers returns the level-ranking users of a forum, mirroring Client.get_rank_users.

func (*Client) GetRecomStatus

func (c *Client) GetRecomStatus(ctx context.Context, ref ForumRef) (getrecomstatus.RecomStatus, error)

GetRecomStatus returns the monthly recommend quota, mirroring Client.get_recom_status.

func (*Client) GetRecovers

func (c *Client) GetRecovers(ctx context.Context, ref ForumRef, pn, rn int64, id UserRef) (getrecovers.Recovers, error)

GetRecovers returns the recoverable posts, mirroring Client.get_recovers.

func (*Client) GetReplys

func (c *Client) GetReplys(ctx context.Context, pn int32) (getreplys.Replys, error)

GetReplys returns the replies received by the logged in account, mirroring Client.get_replys.

func (*Client) GetRoomlistByFID

func (c *Client) GetRoomlistByFID(ctx context.Context, fid int64) (getroomlistbyfid.RoomList, error)

GetRoomlistByFID returns the chatrooms of a forum, mirroring Client.get_roomlist_by_fid.

func (*Client) GetSelfFollowForums

func (c *Client) GetSelfFollowForums(ctx context.Context, pn, rn int64) (getselffollowforums.SelfFollowForums, error)

GetSelfFollowForums returns the forums followed by the account, mirroring Client.get_self_follow_forums.

func (*Client) GetSelfInfo

func (c *Client) GetSelfInfo(ctx context.Context, require enums.ReqUInfo) (classdef.UserInfo, error)

GetSelfInfo returns the cached information of the account, filling the missing fields on demand. It mirrors Client.get_self_info.

func (*Client) GetSelfPosts

func (c *Client) GetSelfPosts(ctx context.Context, pn, rn int32) (getusercontents.UserPostss, error)

GetSelfPosts returns the posts of the account, mirroring Client.get_self_posts.

func (*Client) GetSelfThreads

func (c *Client) GetSelfThreads(ctx context.Context, pn int32, publicOnly bool) (getusercontents.UserThreads, error)

GetSelfThreads returns the threads of the account, mirroring Client.get_self_threads.

func (*Client) GetSquareForums

func (c *Client) GetSquareForums(ctx context.Context, cname string, pn, rn int32) (getsquareforums.SquareForums, error)

GetSquareForums returns the forum square list, mirroring Client.get_square_forums.

func (*Client) GetStatistics

func (c *Client) GetStatistics(ctx context.Context, ref ForumRef) (getstatistics.Statistics, error)

GetStatistics returns the 24-day statistics of the forum backend, mirroring Client.get_statistics.

func (*Client) GetTabMap

func (c *Client) GetTabMap(ctx context.Context, ref ForumRef) (gettabmap.TabMap, error)

GetTabMap returns the mapping from tab name to tab id, mirroring Client.get_tab_map.

func (*Client) GetThreads

func (c *Client) GetThreads(ctx context.Context, fname string, args GetThreadsArgs) (getthreads.Threads, error)

GetThreads returns the thread list of a forum, mirroring Client.get_threads.

It uses the websocket transport when the session is open, falling back to the app HTTP API otherwise.

func (*Client) GetUnblockAppeals

func (c *Client) GetUnblockAppeals(ctx context.Context, ref ForumRef, pn, rn int64) (getunblockappeals.Appeals, error)

GetUnblockAppeals returns the unblock appeal list, mirroring Client.get_unblock_appeals.

func (*Client) GetUserForumInfo

func (c *Client) GetUserForumInfo(ctx context.Context, ref ForumRef, id UserRef) (getuserforuminfo.UserForumInfo, error)

GetUserForumInfo returns the information of a user in a forum, mirroring Client.get_user_forum_info.

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(ctx context.Context, ref UserRef, require enums.ReqUInfo) (classdef.UserInfo, error)

GetUserInfo returns the information of a user, mirroring Client.get_user_info.

The Python client returns a different specialised type per endpoint; this port normalises every branch into classdef.UserInfo so callers see one stable type while the request itself stays identical. Branches whose endpoint has not been migrated yet fail with exception.ErrNotMigrated.

func (*Client) GetUserPosts

func (c *Client) GetUserPosts(ctx context.Context, id UserRef, pn, rn int32) (getusercontents.UserPostss, error)

GetUserPosts returns the posts of a user, mirroring Client.get_user_posts.

func (*Client) GetUserPostsPc

func (c *Client) GetUserPostsPc(ctx context.Context, id UserRef, pn, rn int64) (getusercontentpc.PcUserPosts, error)

GetUserPostsPc returns the posts of a user over the pc channel, mirroring Client.get_user_posts_pc.

func (*Client) GetUserThreads

func (c *Client) GetUserThreads(ctx context.Context, id UserRef, pn int32) (getusercontents.UserThreads, error)

GetUserThreads returns the threads of a user, mirroring Client.get_user_threads.

func (*Client) Good

func (c *Client) Good(ctx context.Context, ref ForumRef, tid int64, cname string) (exception.BoolResponse, error)

Good marks a thread as excellent, mirroring Client.good.

func (*Client) HTTPCore

func (c *Client) HTTPCore() *core.HttpCore

HTTPCore exposes the HTTP session of the client.

func (*Client) HandleUnblockAppeals

func (c *Client) HandleUnblockAppeals(ctx context.Context, ref ForumRef, appealIDs []int64, refuse bool) (exception.BoolResponse, error)

HandleUnblockAppeals accepts or refuses unblock appeals, mirroring Client.handle_unblock_appeals.

func (*Client) Hash2Image

func (c *Client) Hash2Image(ctx context.Context, rawHash, size string) (getimages.Image, error)

Hash2Image fetches the image of a Baidu image hash, mirroring Client.hash2image.

func (*Client) HideThread

func (c *Client) HideThread(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

HideThread hides a thread, mirroring Client.hide_thread.

func (*Client) InitClientID

func (c *Client) InitClientID(ctx context.Context) error

InitClientID loads the client id of the account when it is missing. It mirrors the private Client.__init_client_id.

func (*Client) InitSampleID

func (c *Client) InitSampleID(ctx context.Context) error

InitSampleID loads the sample id of the account when it is missing. It mirrors the private Client.__init_sample_id.

func (*Client) InitTbs

func (c *Client) InitTbs(ctx context.Context) error

InitTbs loads the tbs token of the account when it is missing. It mirrors the private Client.__init_tbs.

func (*Client) InitWebsocket

func (c *Client) InitWebsocket(ctx context.Context) (bool, error)

InitWebsocket connects the websocket session and uploads the secret key, mirroring Client.init_websocket. It is a no-op when the session is not closed.

func (*Client) InitZID

func (c *Client) InitZID(ctx context.Context) error

InitZID loads the z_id of the account when it is missing. It mirrors the private Client.__init_z_id.

func (*Client) JoinChatroom

func (c *Client) JoinChatroom(ctx context.Context, roomID int64) (exception.BoolResponse, error)

JoinChatroom joins a chatroom, mirroring Client.join_chatroom.

func (*Client) Login

func (c *Client) Login(ctx context.Context) error

Login refreshes the cached user information and the tbs token. It mirrors the private Client.__login.

func (*Client) Move

func (c *Client) Move(ctx context.Context, ref ForumRef, tid, toTabID, fromTabID int64) (exception.BoolResponse, error)

Move moves a thread to another tab, mirroring Client.move.

func (*Client) Recommend

func (c *Client) Recommend(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

Recommend pushes a thread to the personalised home page, mirroring Client.recommend.

func (*Client) Recover

func (c *Client) Recover(ctx context.Context, ref ForumRef, tid, pid int64, isHide bool) (exception.BoolResponse, error)

Recover recovers a thread or a reply, mirroring Client.recover.

func (*Client) RecoverPost

func (c *Client) RecoverPost(ctx context.Context, ref ForumRef, pid int64) (exception.BoolResponse, error)

RecoverPost recovers a reply, mirroring Client.recover_post.

func (*Client) RecoverThread

func (c *Client) RecoverThread(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

RecoverThread recovers a thread, mirroring Client.recover_thread.

func (*Client) RemoveFan

func (c *Client) RemoveFan(ctx context.Context, id UserRef) (exception.BoolResponse, error)

RemoveFan removes a fan, mirroring Client.remove_fan.

func (*Client) SearchExact

func (c *Client) SearchExact(ctx context.Context, ref ForumRef, query string, pn, rn int64, searchType enums.SearchType, onlyThread bool) (searchexact.ExactSearches, error)

SearchExact searches within a forum, mirroring Client.search_exact.

func (*Client) SearchGlobal

func (c *Client) SearchGlobal(ctx context.Context, word string, pn, rn, sort int64) (searchglobal.GlobalSearches, error)

SearchGlobal searches the whole forum site, mirroring Client.search_global.

func (*Client) SendChatroomMsg

func (c *Client) SendChatroomMsg(ctx context.Context, chatroomID, fid int64, text string, atUserIDs []int64, robotc int64) (exception.BoolResponse, error)

SendChatroomMsg sends a plain text message to a forum group, mirroring Client.send_chatroom_msg.

The cached self information (c.user) must carry user_id and portrait, which the Python client populates through get_self_info.

func (*Client) SendMsg

func (c *Client) SendMsg(ctx context.Context, id UserRef, content string) (exception.BoolResponse, error)

SendMsg sends a private message, mirroring Client.send_msg.

The API is websocket only. The returned msg id is recorded in the message id manager so that subsequent reads continue from it.

func (*Client) SetAccount

func (c *Client) SetAccount(newAccount *core.Account) error

SetAccount swaps the account of every session, mirroring the Python account setter.

func (*Client) SetBawuPerm

func (c *Client) SetBawuPerm(ctx context.Context, ref ForumRef, id UserRef, perms enums.BawuPermType) (exception.BoolResponse, error)

SetBawuPerm assigns permissions to a moderator, mirroring Client.set_bawu_perm.

func (*Client) SetBlacklist

func (c *Client) SetBlacklist(ctx context.Context, id UserRef, btype enums.BlacklistType) (exception.BoolResponse, error)

SetBlacklist sets the new user blacklist for a user, mirroring Client.set_blacklist.

func (*Client) SetMsgReaded

func (c *Client) SetMsgReaded(ctx context.Context, message getgroupmsg.WsMessage) (exception.BoolResponse, error)

SetMsgReaded marks a private message as read, mirroring Client.set_msg_readed.

func (*Client) SetNicknameOld

func (c *Client) SetNicknameOld(ctx context.Context, nickName string) (exception.BoolResponse, error)

SetNicknameOld updates the legacy nickname, mirroring Client.set_nickname_old.

func (*Client) SetProfile

func (c *Client) SetProfile(ctx context.Context, nickName, sign string, gender enums.Gender) (exception.BoolResponse, error)

SetProfile updates the profile of the logged in account, mirroring Client.set_profile.

func (*Client) SetThreadPrivacy

func (c *Client) SetThreadPrivacy(ctx context.Context, ref ForumRef, tid, pid int64, isHide bool) (exception.BoolResponse, error)

SetThreadPrivacy hides or unhides a thread or a reply, mirroring Client.set_thread_privacy.

func (*Client) SetThreadPrivate

func (c *Client) SetThreadPrivate(ctx context.Context, ref ForumRef, tid, pid int64) (exception.BoolResponse, error)

SetThreadPrivate hides a thread or a reply, mirroring Client.set_thread_private.

func (*Client) SetThreadPublic

func (c *Client) SetThreadPublic(ctx context.Context, ref ForumRef, tid, pid int64) (exception.BoolResponse, error)

SetThreadPublic unhides a thread or a reply, mirroring Client.set_thread_public.

func (*Client) SignForum

func (c *Client) SignForum(ctx context.Context, ref ForumRef) (exception.BoolResponse, error)

SignForum signs a single forum, mirroring Client.sign_forum.

func (*Client) SignForums

func (c *Client) SignForums(ctx context.Context) (exception.BoolResponse, error)

SignForums signs every followed forum, mirroring Client.sign_forums.

func (*Client) SignGrowth

func (c *Client) SignGrowth(ctx context.Context) (exception.BoolResponse, error)

SignGrowth completes the growth-level sign task, mirroring Client.sign_growth.

func (*Client) TiebaUID2UserInfo

func (c *Client) TiebaUID2UserInfo(ctx context.Context, tiebaUID int64) (tiebauid2userinfo.UserInfoTUid, error)

TiebaUID2UserInfo returns the information of a user by their tieba uid, mirroring Client.tieba_uid2user_info.

Note that tieba_uid differs from the legacy user_id.

func (*Client) Top

func (c *Client) Top(ctx context.Context, ref ForumRef, tid int64, isVIP bool) (exception.BoolResponse, error)

Top tops a thread, mirroring Client.top.

func (*Client) Unagree

func (c *Client) Unagree(ctx context.Context, tid, pid int64, isComment bool) (exception.BoolResponse, error)

Unagree removes a like, mirroring Client.unagree.

func (*Client) Unblock

func (c *Client) Unblock(ctx context.Context, ref ForumRef, id UserRef) (exception.BoolResponse, error)

Unblock lifts a ban from a user, mirroring Client.unblock.

func (*Client) Undisagree

func (c *Client) Undisagree(ctx context.Context, tid, pid int64, isComment bool) (exception.BoolResponse, error)

Undisagree removes a dislike, mirroring Client.undisagree.

func (*Client) UndislikeForum

func (c *Client) UndislikeForum(ctx context.Context, ref ForumRef) (exception.BoolResponse, error)

UndislikeForum restores a forum on the home page recommendations, mirroring Client.undislike_forum.

func (*Client) UnfollowForum

func (c *Client) UnfollowForum(ctx context.Context, ref ForumRef) (exception.BoolResponse, error)

UnfollowForum unfollows a forum, mirroring Client.unfollow_forum.

func (*Client) UnfollowUser

func (c *Client) UnfollowUser(ctx context.Context, id UserRef) (exception.BoolResponse, error)

UnfollowUser unfollows a user, mirroring Client.unfollow_user.

func (*Client) Ungood

func (c *Client) Ungood(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

Ungood removes the excellent mark of a thread, mirroring Client.ungood.

func (*Client) UnhideThread

func (c *Client) UnhideThread(ctx context.Context, ref ForumRef, tid int64) (exception.BoolResponse, error)

UnhideThread unhides a thread, mirroring Client.unhide_thread.

func (*Client) Untop

func (c *Client) Untop(ctx context.Context, ref ForumRef, tid int64, isVIP bool) (exception.BoolResponse, error)

Untop untops a thread, mirroring Client.untop.

func (*Client) User

func (c *Client) User() classdef.UserInfo

User returns the cached user information of the account. It mirrors the self_info property.

func (*Client) WSCore

func (c *Client) WSCore() *core.WsCore

WSCore exposes the websocket session of the client.

type ForumRef

type ForumRef struct {
	FName string
	FID   int64
}

ForumRef identifies a forum by name or by fid. It mirrors the `fname_or_fid: str | int` argument of the Python client, where the name takes precedence for get_forum and the fid takes precedence for get_forum_detail.

func ByFID

func ByFID(fid int64) ForumRef

ByFID references a forum by its fid.

func ByFName

func ByFName(fname string) ForumRef

ByFName references a forum by its name.

type GetCommentsArgs

type GetCommentsArgs struct {
	Pn        int
	IsComment bool
}

GetCommentsArgs holds the optional arguments of GetComments.

func DefaultGetCommentsArgs

func DefaultGetCommentsArgs() GetCommentsArgs

DefaultGetCommentsArgs returns the Python defaults of GetComments.

type GetPostsArgs

type GetPostsArgs struct {
	Pn                 int
	Rn                 int
	Sort               enums.PostSortType
	OnlyThreadAuthor   bool
	WithComments       bool
	CommentSortByAgree bool
	CommentRn          int
}

GetPostsArgs holds the optional arguments of GetPosts.

func DefaultGetPostsArgs

func DefaultGetPostsArgs() GetPostsArgs

DefaultGetPostsArgs returns the Python defaults of GetPosts.

type GetThreadsArgs

type GetThreadsArgs struct {
	Pn     int
	Rn     int
	Sort   enums.ThreadSortType
	IsGood bool
}

GetThreadsArgs holds the optional arguments of GetThreads.

func DefaultGetThreadsArgs

func DefaultGetThreadsArgs() GetThreadsArgs

DefaultGetThreadsArgs returns the Python defaults of GetThreads.

type Option

type Option func(*clientOptions)

Option configures a Client.

func WithAccount

func WithAccount(account *core.Account) Option

WithAccount sets the account of the client, overriding BDUSS and STOKEN.

func WithProxy

func WithProxy(proxy *config.ProxyConfig) Option

WithProxy sets the proxy configuration.

func WithProxyFromEnv

func WithProxyFromEnv() Option

WithProxyFromEnv uses the proxy described by the environment variables.

func WithTimeout

func WithTimeout(timeout config.TimeoutConfig) Option

WithTimeout sets the timeout configuration.

func WithTryWebsocket

func WithTryWebsocket(try bool) Option

WithTryWebsocket enables the websocket transport with an HTTP fallback.

type UserRef

type UserRef struct {
	UserID   int64
	Portrait string
	UserName string
}

UserRef identifies a user by numeric id, portrait or user name. It mirrors the `id_: str | int` argument of the Python client, where a string is either a portrait ("tb.1.xxx") or a user name.

func ByPortrait

func ByPortrait(portrait string) UserRef

ByPortrait references a user by their portrait.

func ByUserID

func ByUserID(id int64) UserRef

ByUserID references a user by their numeric id.

func ByUserName

func ByUserName(userName string) UserRef

ByUserName references a user by their user name.

func (UserRef) IsZero

func (r UserRef) IsZero() bool

IsZero reports whether the reference carries no identifier.

Directories

Path Synopsis
api
add_bawu
Package addbawu implements the add_bawu API of aiotieba.
Package addbawu implements the add_bawu API of aiotieba.
add_bawu_blacklist
Package addbawublacklist implements the add_bawu_blacklist API of aiotieba.
Package addbawublacklist implements the add_bawu_blacklist API of aiotieba.
add_blacklist_old
Package addblacklistold implements the add_blacklist_old API of aiotieba.
Package addblacklistold implements the add_blacklist_old API of aiotieba.
add_poll
Package addpoll implements the add_poll API of aiotieba.
Package addpoll implements the add_poll API of aiotieba.
add_post
Package addpost implements the add_post API of aiotieba.
Package addpost implements the add_post API of aiotieba.
agree
Package agree implements the agree API of aiotieba.
Package agree implements the agree API of aiotieba.
block
Package block implements the block API of aiotieba.
Package block implements the block API of aiotieba.
classdef
Package classdef holds the shared data models of the API responses.
Package classdef holds the shared data models of the API responses.
del_bawu
Package delbawu implements the del_bawu API of aiotieba.
Package delbawu implements the del_bawu API of aiotieba.
del_bawu_blacklist
Package delbawublacklist implements the del_bawu_blacklist API of aiotieba.
Package delbawublacklist implements the del_bawu_blacklist API of aiotieba.
del_blacklist_old
Package delblacklistold implements the del_blacklist_old API of aiotieba.
Package delblacklistold implements the del_blacklist_old API of aiotieba.
del_post
Package delpost implements the del_post API of aiotieba.
Package delpost implements the del_post API of aiotieba.
del_posts
Package delposts implements the del_posts API of aiotieba.
Package delposts implements the del_posts API of aiotieba.
del_thread
Package delthread implements the del_thread API of aiotieba.
Package delthread implements the del_thread API of aiotieba.
del_threads
Package delthreads implements the del_threads API of aiotieba.
Package delthreads implements the del_threads API of aiotieba.
dislike_forum
Package dislikeforum implements the dislike_forum API of aiotieba.
Package dislikeforum implements the dislike_forum API of aiotieba.
follow_forum
Package followforum implements the follow_forum API of aiotieba.
Package followforum implements the follow_forum API of aiotieba.
follow_user
Package followuser implements the follow_user API of aiotieba.
Package followuser implements the follow_user API of aiotieba.
get_ats
Package getats implements the get_ats API of aiotieba.
Package getats implements the get_ats API of aiotieba.
get_bawu_blacklist
Package getbawublacklist implements the get_bawu_blacklist API of aiotieba.
Package getbawublacklist implements the get_bawu_blacklist API of aiotieba.
get_bawu_info
Package getbawuinfo implements the get_bawu_info API of aiotieba.
Package getbawuinfo implements the get_bawu_info API of aiotieba.
get_bawu_memberlist
Package getbawumemberlist implements the get_bawu_memberlist API of aiotieba.
Package getbawumemberlist implements the get_bawu_memberlist API of aiotieba.
get_bawu_perm
Package getbawuperm implements the get_bawu_perm API of aiotieba.
Package getbawuperm implements the get_bawu_perm API of aiotieba.
get_bawu_postlogs
Package getbawupostlogs implements the get_bawu_postlogs API of aiotieba.
Package getbawupostlogs implements the get_bawu_postlogs API of aiotieba.
get_bawu_userlogs
Package getbawuuserlogs implements the get_bawu_userlogs API of aiotieba.
Package getbawuuserlogs implements the get_bawu_userlogs API of aiotieba.
get_blacklist
Package getblacklist implements the get_blacklist API of aiotieba.
Package getblacklist implements the get_blacklist API of aiotieba.
get_blacklist_old
Package getblacklistold implements the get_blacklist_old API of aiotieba.
Package getblacklistold implements the get_blacklist_old API of aiotieba.
get_blocks
Package getblocks implements the get_blocks API of aiotieba.
Package getblocks implements the get_blocks API of aiotieba.
get_cid
Package getcid implements the get_cid API of aiotieba.
Package getcid implements the get_cid API of aiotieba.
get_comments
Package getcomments implements the get_comments API of aiotieba.
Package getcomments implements the get_comments API of aiotieba.
get_dislike_forums
Package getdislikeforums implements the get_dislike_forums API of aiotieba.
Package getdislikeforums implements the get_dislike_forums API of aiotieba.
get_fans
Package getfans implements the get_fans API of aiotieba.
Package getfans implements the get_fans API of aiotieba.
get_fid
Package getfid implements the get_fid API of aiotieba.
Package getfid implements the get_fid API of aiotieba.
get_follow_forums
Package getfollowforums implements the get_follow_forums API of aiotieba.
Package getfollowforums implements the get_follow_forums API of aiotieba.
get_follow_forums_pc
Package getfollowforumspc implements the get_follow_forums_pc API of aiotieba.
Package getfollowforumspc implements the get_follow_forums_pc API of aiotieba.
get_follows
Package getfollows implements the get_follows API of aiotieba.
Package getfollows implements the get_follows API of aiotieba.
get_forum
Package getforum implements the get_forum API of aiotieba.
Package getforum implements the get_forum API of aiotieba.
get_forum_detail
Package getforumdetail implements the get_forum_detail API of aiotieba.
Package getforumdetail implements the get_forum_detail API of aiotieba.
get_forum_level
Package getforumlevel implements the get_forum_level API of aiotieba.
Package getforumlevel implements the get_forum_level API of aiotieba.
get_group_msg
Package getgroupmsg implements the get_group_msg API of aiotieba.
Package getgroupmsg implements the get_group_msg API of aiotieba.
get_images
Package getimages implements the get_images API of aiotieba.
Package getimages implements the get_images API of aiotieba.
get_last_replyers
Package getlastreplyers implements the get_last_replyers API of aiotieba.
Package getlastreplyers implements the get_last_replyers API of aiotieba.
get_member_users
Package getmemberusers implements the get_member_users API of aiotieba.
Package getmemberusers implements the get_member_users API of aiotieba.
get_posts
Package getposts implements the get_posts API of aiotieba.
Package getposts implements the get_posts API of aiotieba.
get_rank_forums
Package getrankforums implements the get_rank_forums API of aiotieba.
Package getrankforums implements the get_rank_forums API of aiotieba.
get_rank_users
Package getrankusers implements the get_rank_users API of aiotieba.
Package getrankusers implements the get_rank_users API of aiotieba.
get_recom_status
Package getrecomstatus implements the get_recom_status API of aiotieba.
Package getrecomstatus implements the get_recom_status API of aiotieba.
get_recover_info
Package getrecoverinfo implements the get_recover_info API of aiotieba.
Package getrecoverinfo implements the get_recover_info API of aiotieba.
get_recovers
Package getrecovers implements the get_recovers API of aiotieba.
Package getrecovers implements the get_recovers API of aiotieba.
get_replys
Package getreplys implements the get_replys API of aiotieba.
Package getreplys implements the get_replys API of aiotieba.
get_roomlist_by_fid
Package getroomlistbyfid implements the get_roomlist_by_fid API of aiotieba.
Package getroomlistbyfid implements the get_roomlist_by_fid API of aiotieba.
get_self_follow_forums
Package getselffollowforums implements the get_self_follow_forums API of aiotieba.
Package getselffollowforums implements the get_self_follow_forums API of aiotieba.
get_selfinfo_initNickname
Package getselfinfoinitnickname implements the get_selfinfo_initNickname API of aiotieba.
Package getselfinfoinitnickname implements the get_selfinfo_initNickname API of aiotieba.
get_selfinfo_moindex
Package getselfinfomoindex implements the get_selfinfo_moindex API of aiotieba.
Package getselfinfomoindex implements the get_selfinfo_moindex API of aiotieba.
get_square_forums
Package getsquareforums implements the get_square_forums API of aiotieba.
Package getsquareforums implements the get_square_forums API of aiotieba.
get_statistics
Package getstatistics implements the get_statistics API of aiotieba.
Package getstatistics implements the get_statistics API of aiotieba.
get_tab_map
Package gettabmap implements the get_tab_map API of aiotieba.
Package gettabmap implements the get_tab_map API of aiotieba.
get_threads
Package getthreads implements the get_threads API of aiotieba.
Package getthreads implements the get_threads API of aiotieba.
get_uinfo_getUserInfo_web
Package getuserinfoweb implements the get_uinfo_getUserInfo_web API of aiotieba.
Package getuserinfoweb implements the get_uinfo_getUserInfo_web API of aiotieba.
get_uinfo_getuserinfo_app
Package getuserinfoapp implements the get_uinfo_getuserinfo_app API of aiotieba.
Package getuserinfoapp implements the get_uinfo_getuserinfo_app API of aiotieba.
get_uinfo_panel
Package getuinfopanel implements the get_uinfo_panel API of aiotieba.
Package getuinfopanel implements the get_uinfo_panel API of aiotieba.
get_uinfo_userCard
Package getuserinfousercard implements the get_uinfo_userCard API of aiotieba.
Package getuserinfousercard implements the get_uinfo_userCard API of aiotieba.
get_uinfo_user_json
Package getuserjson implements the get_uinfo_user_json API of aiotieba.
Package getuserjson implements the get_uinfo_user_json API of aiotieba.
get_unblock_appeals
Package getunblockappeals implements the get_unblock_appeals API of aiotieba.
Package getunblockappeals implements the get_unblock_appeals API of aiotieba.
get_user_contents
Package getusercontents implements the get_user_contents API of aiotieba.
Package getusercontents implements the get_user_contents API of aiotieba.
get_user_contents/get_posts
Package getusercontentsposts implements the get_posts sub-API of get_user_contents.
Package getusercontentsposts implements the get_posts sub-API of get_user_contents.
get_user_contents/get_threads
Package getusercontentsthreads implements the get_threads sub-API of get_user_contents.
Package getusercontentsthreads implements the get_threads sub-API of get_user_contents.
get_user_contents_pc
Package getusercontentpc implements the get_user_contents_pc API of aiotieba.
Package getusercontentpc implements the get_user_contents_pc API of aiotieba.
get_user_forum_info
Package getuserforuminfo implements the get_user_forum_info API of aiotieba.
Package getuserforuminfo implements the get_user_forum_info API of aiotieba.
good
Package good implements the good API of aiotieba.
Package good implements the good API of aiotieba.
handle_unblock_appeals
Package handleunblockappeals implements the handle_unblock_appeals API of aiotieba.
Package handleunblockappeals implements the handle_unblock_appeals API of aiotieba.
init_websocket
Package initwebsocket implements the init_websocket API of aiotieba.
Package initwebsocket implements the init_websocket API of aiotieba.
init_z_id
Package initzid implements the init_z_id API of aiotieba.
Package initzid implements the init_z_id API of aiotieba.
login
Package login implements the login API of aiotieba.
Package login implements the login API of aiotieba.
move
Package move implements the move API of aiotieba.
Package move implements the move API of aiotieba.
profile
Package profile holds the shared data models of the user profile endpoints.
Package profile holds the shared data models of the user profile endpoints.
profile/get_homepage
Package gethomepage implements profile.get_homepage of aiotieba.
Package gethomepage implements profile.get_homepage of aiotieba.
profile/get_uinfo_profile
Package getuinfoprofile implements profile.get_uinfo_profile of aiotieba.
Package getuinfoprofile implements profile.get_uinfo_profile of aiotieba.
push_notify
Package pushnotify implements the push_notify API of aiotieba.
Package pushnotify implements the push_notify API of aiotieba.
recommend
Package recommend implements the recommend API of aiotieba.
Package recommend implements the recommend API of aiotieba.
recover
Package recover implements the recover API of aiotieba.
Package recover implements the recover API of aiotieba.
remove_fan
Package removefan implements the remove_fan API of aiotieba.
Package removefan implements the remove_fan API of aiotieba.
search_exact
Package searchexact implements the search_exact API of aiotieba.
Package searchexact implements the search_exact API of aiotieba.
search_global
Package searchglobal implements the search_global API of aiotieba.
Package searchglobal implements the search_global API of aiotieba.
send_chatroom_msg
Package sendchatroommsg implements the send_chatroom_msg API of aiotieba.
Package sendchatroommsg implements the send_chatroom_msg API of aiotieba.
send_msg
Package sendmsg implements the send_msg API of aiotieba.
Package sendmsg implements the send_msg API of aiotieba.
set_bawu_perm
Package setbawuperm implements the set_bawu_perm API of aiotieba.
Package setbawuperm implements the set_bawu_perm API of aiotieba.
set_blacklist
Package setblacklist implements the set_blacklist API of aiotieba.
Package setblacklist implements the set_blacklist API of aiotieba.
set_msg_readed
Package setmsgreaded implements the set_msg_readed API of aiotieba.
Package setmsgreaded implements the set_msg_readed API of aiotieba.
set_nickname_old
Package setnicknameold implements the set_nickname_old API of aiotieba.
Package setnicknameold implements the set_nickname_old API of aiotieba.
set_profile
Package setprofile implements the set_profile API of aiotieba.
Package setprofile implements the set_profile API of aiotieba.
set_thread_privacy
Package setthreadprivacy implements the set_thread_privacy API of aiotieba.
Package setthreadprivacy implements the set_thread_privacy API of aiotieba.
sign_forum
Package signforum implements the sign_forum API of aiotieba.
Package signforum implements the sign_forum API of aiotieba.
sign_forums
Package signforums implements the sign_forums API of aiotieba.
Package signforums implements the sign_forums API of aiotieba.
sign_growth
Package signgrowth implements the sign_growth API of aiotieba.
Package signgrowth implements the sign_growth API of aiotieba.
sync
Package sync implements the sync API of aiotieba.
Package sync implements the sync API of aiotieba.
tieba_uid2user_info
Package tiebauid2userinfo implements the tieba_uid2user_info API of aiotieba.
Package tiebauid2userinfo implements the tieba_uid2user_info API of aiotieba.
top
Package top implements the top API of aiotieba.
Package top implements the top API of aiotieba.
unblock
Package unblock implements the unblock API of aiotieba.
Package unblock implements the unblock API of aiotieba.
undislike_forum
Package undislikeforum implements the undislike_forum API of aiotieba.
Package undislikeforum implements the undislike_forum API of aiotieba.
unfollow_forum
Package unfollowforum implements the unfollow_forum API of aiotieba.
Package unfollowforum implements the unfollow_forum API of aiotieba.
unfollow_user
Package unfollowuser implements the unfollow_user API of aiotieba.
Package unfollowuser implements the unfollow_user API of aiotieba.
ungood
Package ungood implements the ungood API of aiotieba.
Package ungood implements the ungood API of aiotieba.
Package config defines the proxy and timeout configuration used by the client.
Package config defines the proxy and timeout configuration used by the client.
Package consts holds version strings and base hosts shared by the Tieba APIs.
Package consts holds version strings and base hosts shared by the Tieba APIs.
Package core implements the network layer of the client: the account state container, the HTTP session, the websocket session and the BLCP session.
Package core implements the network layer of the client: the account state container, the HTTP session, the websocket session and the BLCP session.
Package enums defines the enumerated types used across the library.
Package enums defines the enumerated types used across the library.
Package exception defines the error and response types of the library.
Package exception defines the error and response types of the library.
Package helper provides the internal utilities shared by the API modules.
Package helper provides the internal utilities shared by the API modules.
crypto
Package crypto implements the Baidu Tieba client cryptography.
Package crypto implements the Baidu Tieba client cryptography.
htmlutil
Package htmlutil provides a small subset of the BeautifulSoup DOM helpers used by the forum-backend HTML scraping APIs.
Package htmlutil provides a small subset of the BeautifulSoup DOM helpers used by the forum-backend HTML scraping APIs.
Package logging provides the library logger.
Package logging provides the library logger.
tools
genproto command
Command genproto generates the Go protobuf bindings for every .proto file of the project.
Command genproto generates the Go protobuf bindings for every .proto file of the project.

Jump to

Keyboard shortcuts

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