Documentation ¶
Index ¶
- Constants
- Variables
- func AddSign(form *map[string]string, client_type string)
- func Addslashes(str string) string
- func ApiTemplate[T any](code int, message string, data T, version string) _type.ApiTemplate
- func AppendStrings(s ...string) string
- func ConnectToMySQL(username string, password string, endpoint string, dbname string, ...) (*gorm.DB, *gorm.DB, error)
- func ConnectToSQLite(path string, logLevel logger.LogLevel, servicePrefix string) (*gorm.DB, *gorm.DB, error)
- func CreatePasswordHash(password string) ([]byte, error)
- func DeleteOption(keyName string, ext ...any) error
- func DeleteUserOption(keyName string, uid string, ext ...any) error
- func EchoNoContent(c echo.Context) error
- func EchoReject(c echo.Context) error
- func Fetch(_url string, _method string, _body []byte, _headers map[string]string, ...) ([]byte, error)
- func GenHMAC256(ciphertext, key []byte) []byte
- func GetBaiduUserInfo(cookie _type.TypeCookie) (*_type.BaiduUserInfoResponse, error)
- func GetCookie(pid int32, bduss_only ...bool) _type.TypeCookie
- func GetFid(name string) int64
- func GetForumList(cookie _type.TypeCookie, uid string, page int64) (*_type.ForumListResponse, error)
- func GetForumNameShare(name string) (*_type.ForumNameShareResponse, error)
- func GetGravatarLink(email string) string
- func GetLoginQRCode() (*_type.LoginQRCode, error)
- func GetLoginResponse(tmpBDUSS string) (*_type.LoginResponse, error)
- func GetManagerInfo(fid uint64) (*tbpb.GetBawuInfoResIdl_DataRes, error)
- func GetManagerStatus(portrait string, fid int64) (*_type.IsManagerPreCheckResponse, error)
- func GetManagerTasks(cookie _type.TypeCookie, fid int64) (*_type.ManagerTasksResponse, error)
- func GetOneKeySignList(cookie _type.TypeCookie) (any, error)
- func GetOption(keyName string) string
- func GetSemver(cur, ver2 string) string
- func GetTbs(bduss string) (*_type.TbsResponse, error)
- func GetUnicastResponse(sign string) (*_type.WrapUnicastResponse, error)
- func GetUserInfoByTiebaUID(tbuid string) (*tbpb.GetUserByTiebaUidResIdl_DataRes, error)
- func GetUserInfoByUsernameOrPortrait(requestType string, value string) (*_type.TiebaPanelUserInfoResponse, error)
- func GetUserOption(keyName string, uid string) string
- func GetWebForumList(cookie _type.TypeCookie, page int64) (*_type.WebForumListResponse, error)
- func HtmlSpecialchars(html string) string
- func InitClient(timeout int) *http.Client
- func InitOptions()
- func IsOfficialSupport() bool
- func JsonDecode[T any](jsonByte []byte, template *T) error
- func JsonEncode[T any](data T) ([]byte, error)
- func LocaleTimeDiff(hour int64) int64
- func Md5(str string) string
- func MultipartBodyBuilder(_body map[string]any, files ...MultipartBodyBinaryFileType) ([]byte, string, error)
- func PostCheckinClient(cookie _type.TypeCookie, kw string, fid int32) (*_type.ClientSignResponse, error)
- func PostSync(cookie _type.TypeCookie) (any, error)
- func RandomEmoji() string
- func RemoveLeadingZeros(data []byte) []byte
- func ScanTiebaByPid(pid int32)
- func SendBark(_to, title, body string) error
- func SendEmail(_to, title, body string) error
- func SendMessage(_type string, uid int32, _subject, _body string) error
- func SendNtfy(_to, title, body string) error
- func SetOption[T ~string | ~bool | ~int](keyName string, value T, ext ...any) error
- func SetUserOption[T ~string | ~bool | ~int](keyName string, value T, uid string, ext ...any) error
- func Sha1(str string) string
- func Sha256(str []byte) string
- func TBFetch(_url string, _method string, _body []byte, _headers map[string]string) ([]byte, error)
- func UpdateNow()
- func Upgrade(version string) error
- func VariablePtrWrapper[T any](anyValue T) *T
- func VariableWrapper[T any](anyValue T) T
- func VerifyEmail(email string) bool
- func VerifyPasswordHash(hashedPassword string, password string) error
- func VerifyURL(_url string) bool
- type BarkResponseStruct
- type GithubReleasesListResponseItem
- type GormDBPool
- type MultipartBodyBinaryFileType
- type NtfyResponseStruct
- type PushMessageTemplateStruct
- type ResetPwdStruct
Constants ¶
View Source
const BrowserUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
View Source
const ClientUserAgent = "tieba/" + ClientVersion
View Source
const ClientVersion = "12.58.1.0"
View Source
const ResetPwdExpire = 60 * 30
View Source
const ResetPwdMaxTimes = 5
Variables ¶
View Source
var CookieList sync.Map //= make(map[int32]_type.TypeCookie)
View Source
var DefaultCient *http.Client
View Source
var EchoEmptyArray = make([]string, 0)
View Source
var EchoEmptyObject = make(map[string]any, 0)
View Source
var EmptyHeaders = map[string]string{}
View Source
var FidList sync.Map //= make(map[string]int64)
View Source
var GormDB = new(GormDBPool)
View Source
var IgnoreProxy bool
View Source
var LocalTime, _ = time.LoadLocation("Asia/Shanghai")
Tieba works in GMT+8
View Source
var MessageTypeList = []string{"email", "ntfy", "bark"}
View Source
var Now = time.Now().In(LocalTime)
View Source
var Options sync.Map // make(map[string]string)
View Source
var ResetPwdList sync.Map //= make(map[int32]*ResetPwdStruct)
View Source
var SettingsFilter = SettingsKeys
View Source
var SettingsKeys = []string{"ann", "system_url", "stop_reg", "enable_reg", "yr_reg", "cktime", "sign_mode", "sign_hour", "cron_limit", "sign_sleep", "retry_max", "mail_name", "mail_yourname", "mail_host", "mail_port", "mail_secure", "mail_auth", "mail_smtpname", "mail_smtppw", "go_forum_sync_policy", "go_ntfy_addr", "go_bark_addr"} // "system_name", "system_keywords", "system_description"
View Source
var TBClient *http.Client
Functions ¶
func Addslashes ¶
func ApiTemplate ¶
func AppendStrings ¶
func ConnectToMySQL ¶
func ConnectToSQLite ¶
func CreatePasswordHash ¶
func DeleteOption ¶
func EchoNoContent ¶
func EchoNoContent(c echo.Context) error
func EchoReject ¶
func EchoReject(c echo.Context) error
func GenHMAC256 ¶
func GetBaiduUserInfo ¶
func GetBaiduUserInfo(cookie _type.TypeCookie) (*_type.BaiduUserInfoResponse, error)
func GetForumList ¶
func GetForumList(cookie _type.TypeCookie, uid string, page int64) (*_type.ForumListResponse, error)
func GetForumNameShare ¶
func GetForumNameShare(name string) (*_type.ForumNameShareResponse, error)
func GetGravatarLink ¶
func GetLoginQRCode ¶
func GetLoginQRCode() (*_type.LoginQRCode, error)
func GetLoginResponse ¶
func GetLoginResponse(tmpBDUSS string) (*_type.LoginResponse, error)
func GetManagerInfo ¶
func GetManagerInfo(fid uint64) (*tbpb.GetBawuInfoResIdl_DataRes, error)
func GetManagerStatus ¶
func GetManagerStatus(portrait string, fid int64) (*_type.IsManagerPreCheckResponse, error)
func GetManagerTasks ¶
func GetManagerTasks(cookie _type.TypeCookie, fid int64) (*_type.ManagerTasksResponse, error)
func GetOneKeySignList ¶
func GetOneKeySignList(cookie _type.TypeCookie) (any, error)
func GetUnicastResponse ¶
func GetUnicastResponse(sign string) (*_type.WrapUnicastResponse, error)
func GetUserInfoByTiebaUID ¶
func GetUserInfoByTiebaUID(tbuid string) (*tbpb.GetUserByTiebaUidResIdl_DataRes, error)
func GetUserInfoByUsernameOrPortrait ¶
func GetUserInfoByUsernameOrPortrait(requestType string, value string) (*_type.TiebaPanelUserInfoResponse, error)
func GetUserOption ¶
func GetWebForumList ¶
func GetWebForumList(cookie _type.TypeCookie, page int64) (*_type.WebForumListResponse, error)
func HtmlSpecialchars ¶
func InitClient ¶
func InitOptions ¶
func InitOptions()
func IsOfficialSupport ¶
func IsOfficialSupport() bool
func JsonDecode ¶
func JsonEncode ¶
func MultipartBodyBuilder ¶
func PostCheckinClient ¶
func PostCheckinClient(cookie _type.TypeCookie, kw string, fid int32) (*_type.ClientSignResponse, error)
func PostSync ¶
func PostSync(cookie _type.TypeCookie) (any, error)
!!! Calling this api will change the IP location !!! / DO NOT ASK ME WHY THE RESPONSE IS `ANY`!!!
func RandomEmoji ¶
func RandomEmoji() string
func ScanTiebaByPid ¶
func ScanTiebaByPid(pid int32)
func SetUserOption ¶
func VariablePtrWrapper ¶
func VariablePtrWrapper[T any](anyValue T) *T
func VariableWrapper ¶
func VariableWrapper[T any](anyValue T) T
func VerifyEmail ¶
func VerifyPasswordHash ¶
Types ¶
type BarkResponseStruct ¶
type GithubReleasesListResponseItem ¶
type GithubReleasesListResponseItem struct { HTMLURL string `json:"html_url,omitempty"` ID int `json:"id,omitempty"` TagName string `json:"tag_name,omitempty"` TargetCommitish string `json:"target_commitish,omitempty"` Name string `json:"name,omitempty"` Draft bool `json:"draft,omitempty"` Prerelease bool `json:"prerelease,omitempty"` CreatedAt string `json:"created_at,omitempty"` PublishedAt string `json:"published_at,omitempty"` Assets []struct { URL string `json:"url,omitempty"` Name string `json:"name,omitempty"` State string `json:"state,omitempty"` Size int `json:"size,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` BrowserDownloadURL string `json:"browser_download_url,omitempty"` } `json:"assets,omitempty"` Body string `json:"body,omitempty"` }
type NtfyResponseStruct ¶
type PushMessageTemplateStruct ¶
func PushMessageTemplateResetPassword ¶
func PushMessageTemplateResetPassword(verifyMessage, code string) PushMessageTemplateStruct
func PushMessageTestTemplate ¶
func PushMessageTestTemplate() PushMessageTemplateStruct
Click to show internal directories.
Click to hide internal directories.