Documentation ¶
Index ¶
- Constants
- Variables
- func GenRandString(n int) string
- type AvatarImage
- type BackgroundImage
- type Client
- func (c *Client) CreatePost(ctx context.Context, req *CreatePostReq) (*CreatePostRsp, error)
- func (c *Client) LoginWithPhoneAndPassword(ctx context.Context, req *LoginWithPhoneAndPasswordReq) (*LoginWithPhoneAndPasswordRsp, error)
- func (c *Client) Upload(ctx context.Context, req *UploadReq) (*UploadRsp, error)
- func (c *Client) UploadToken(ctx context.Context, req *UploadTokenReq) (*UploadTokenRsp, error)
- type CreatePostReq
- type CreatePostRsp
- type CreatePostRspData
- type Decorations
- type LatestVisitor
- type LoginWithPhoneAndPasswordReq
- type LoginWithPhoneAndPasswordRsp
- type OptFunc
- type Picture
- type Preferences
- type ProfileTag
- type ProfileVisitInfo
- type QqUserInfo
- type RefRemark
- type RelationshipState
- type RestrictedAvatarChange
- type RestrictedNameChange
- type Rollouts
- type School
- type ScrollingSubtitle
- type SquarePicture
- type StatsCount
- type Tips
- type Topic
- type UploadReq
- type UploadRsp
- type UploadTokenReq
- type UploadTokenRsp
- type UploadType
- type User
- type WmpShare
Constants ¶
View Source
const (
Posts = "/originalPosts"
)
View Source
const (
Users = "/users"
)
Variables ¶
View Source
var (
ErrUnknown = errors.New("unknown error")
)
Functions ¶
func GenRandString ¶
Types ¶
type AvatarImage ¶
type BackgroundImage ¶
type BackgroundImage struct {
PicUrl string `json:"picUrl"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreatePost ¶
func (c *Client) CreatePost(ctx context.Context, req *CreatePostReq) (*CreatePostRsp, error)
func (*Client) LoginWithPhoneAndPassword ¶
func (c *Client) LoginWithPhoneAndPassword(ctx context.Context, req *LoginWithPhoneAndPasswordReq) ( *LoginWithPhoneAndPasswordRsp, error)
todo: 何时刷新 token?
func (*Client) UploadToken ¶
func (c *Client) UploadToken(ctx context.Context, req *UploadTokenReq) (*UploadTokenRsp, error)
type CreatePostReq ¶
type CreatePostRsp ¶
type CreatePostRsp struct { Success bool `json:"success"` Toast string `json:"toast"` Data CreatePostRspData `json:"data"` }
type CreatePostRspData ¶
type CreatePostRspData struct { Id string `json:"id"` Type string `json:"type"` Content string `json:"content"` UrlsInText json.RawMessage `json:"urlsInText"` Status string `json:"status"` IsCommentForbidden bool `json:"isCommentForbidden"` LikeCount int `json:"likeCount"` CommentCount int `json:"commentCount"` RepostCount int `json:"repostCount"` Topic Topic `json:"topic"` Pictures []Picture `json:"pictures"` Collected bool `json:"collected"` CollectTime json.RawMessage `json:"collectTime"` User LatestVisitor `json:"user"` CreatedAt time.Time `json:"createdAt"` IsFeatured bool `json:"isFeatured"` EnablePictureComments bool `json:"enablePictureComments"` Repostable bool `json:"repostable"` Rollouts Rollouts `json:"rollouts"` ScrollingSubtitles []ScrollingSubtitle `json:"scrollingSubtitles"` }
type Decorations ¶
type Decorations = json.RawMessage
type LatestVisitor ¶
type LatestVisitor struct { Id string `json:"id"` Username string `json:"username"` ScreenName string `json:"screenName"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` IsVerified bool `json:"isVerified"` VerifyMessage string `json:"verifyMessage"` BriefIntro string `json:"briefIntro"` AvatarImage AvatarImage `json:"avatarImage"` Decorations Decorations `json:"decorations"` ProfileImageUrl string `json:"profileImageUrl"` StatsCount StatsCount `json:"statsCount"` IsBannedForever bool `json:"isBannedForever"` IsSponsor bool `json:"isSponsor"` BackgroundImage BackgroundImage `json:"backgroundImage"` Bio string `json:"bio"` Gender string `json:"gender"` City string `json:"city"` Country string `json:"country"` Province string `json:"province"` RefRemark RefRemark `json:"refRemark"` }
type LoginWithPhoneAndPasswordRsp ¶
type LoginWithPhoneAndPasswordRsp struct { IsRegister bool `json:"isRegister"` User User `json:"user"` EnabledFeatures []string `json:"enabledFeatures"` AgreedProtocol json.RawMessage `json:"agreedProtocol"` }
type Picture ¶
type Picture struct { Key string `json:"key"` ThumbnailUrl string `json:"thumbnailUrl"` SmallPicUrl string `json:"smallPicUrl"` MiddlePicUrl string `json:"middlePicUrl"` PicUrl string `json:"picUrl"` Format string `json:"format"` CropperPosX float64 `json:"cropperPosX"` CropperPosY float64 `json:"cropperPosY"` Width int `json:"width"` Height int `json:"height"` }
type Preferences ¶
type Preferences struct { PersonalizedRecommendationOn bool `json:"personalizedRecommendationOn"` AutoPlayVideo bool `json:"autoPlayVideo"` TopicTagGuideOn bool `json:"topicTagGuideOn"` DailyNotificationOn bool `json:"dailyNotificationOn"` FollowedNotificationOn bool `json:"followedNotificationOn"` ReplyNotificationAllowGroup string `json:"replyNotificationAllowGroup"` LikeNotificationOn bool `json:"likeNotificationOn"` RespectNotificationOn bool `json:"respectNotificationOn"` MentionNotificationOn bool `json:"mentionNotificationOn"` LiveNotificationOn bool `json:"liveNotificationOn"` SubscribeWeatherForecast bool `json:"subscribeWeatherForecast"` PrivateTopicSubscribe bool `json:"privateTopicSubscribe"` UndiscoverableByPhoneNumber bool `json:"undiscoverableByPhoneNumber"` SaveDataUsageMode bool `json:"saveDataUsageMode"` TopicPushSettings string `json:"topicPushSettings"` DebugLogOn bool `json:"debugLogOn"` Env string `json:"env"` SyncCommentToPersonalActivity bool `json:"syncCommentToPersonalActivity"` RepostWithComment bool `json:"repostWithComment"` EnablePrivateChat bool `json:"enablePrivateChat"` BlockStrangerPoke bool `json:"blockStrangerPoke"` EnablePictureWatermark bool `json:"enablePictureWatermark"` EnableOperationPush bool `json:"enableOperationPush"` EnableChatSound bool `json:"enableChatSound"` HideSubscribeTab bool `json:"hideSubscribeTab"` OpenMessageTabOnLaunch bool `json:"openMessageTabOnLaunch"` TabOnLaunch string `json:"tabOnLaunch"` UndiscoverableByWeiboUser json.RawMessage `json:"undiscoverableByWeiboUser"` PaidMarket json.RawMessage `json:"paidMarket"` FollowingUpdatesSortBy string `json:"followingUpdatesSortBy"` }
type ProfileTag ¶
type ProfileVisitInfo ¶
type ProfileVisitInfo struct { TodayCount int `json:"todayCount"` LatestVisitor LatestVisitor `json:"latestVisitor"` }
type QqUserInfo ¶
type RelationshipState ¶
type RestrictedAvatarChange ¶
type RestrictedNameChange ¶
type ScrollingSubtitle ¶
type SquarePicture ¶
type SquarePicture struct { Format string `json:"format"` PicUrl string `json:"picUrl"` MiddlePicUrl string `json:"middlePicUrl"` SmallPicUrl string `json:"smallPicUrl"` ThumbnailUrl string `json:"thumbnailUrl"` LivePhoto json.RawMessage `json:"livePhoto"` Themes json.RawMessage `json:"themes"` Nft json.RawMessage `json:"nft"` }
type StatsCount ¶
type StatsCount struct { TopicSubscribed int `json:"topicSubscribed"` TopicCreated int `json:"topicCreated"` FollowedCount int `json:"followedCount"` FollowingCount int `json:"followingCount"` HighlightedPersonalUpdates int `json:"highlightedPersonalUpdates"` Liked int `json:"liked"` RespectedCount int `json:"respectedCount"` }
type Topic ¶
type Topic struct { Id string `json:"id"` Type string `json:"type"` Content string `json:"content"` SubscribersCount int `json:"subscribersCount"` SquarePicture SquarePicture `json:"squarePicture"` BriefIntro string `json:"briefIntro"` TopicType string `json:"topicType"` OperateStatus string `json:"operateStatus"` IsValid bool `json:"isValid"` IsVerified bool `json:"isVerified"` TopicId int `json:"topicId"` IsSearchable bool `json:"isSearchable"` LikeIcon string `json:"likeIcon"` MessagePrefix string `json:"messagePrefix"` InternalTags json.RawMessage `json:"internalTags"` CustomTags json.RawMessage `json:"customTags"` AuditStatus string `json:"auditStatus"` NewCategory json.RawMessage `json:"newCategory"` InvolvedUsers json.RawMessage `json:"involvedUsers"` EntryTab string `json:"entryTab"` Tabs json.RawMessage `json:"tabs"` RectanglePicture json.RawMessage `json:"rectanglePicture"` PictureUrl string `json:"pictureUrl"` ThumbnailUrl string `json:"thumbnailUrl"` SubscribedStatusRawValue int `json:"subscribedStatusRawValue"` SubscribedAt string `json:"subscribedAt"` Ref string `json:"ref"` IsDreamTopic bool `json:"isDreamTopic"` IsAnonymous bool `json:"isAnonymous"` EnablePictureComments bool `json:"enablePictureComments"` EnablePictureWatermark bool `json:"enablePictureWatermark"` TimeForRank string `json:"timeForRank"` LastMessagePostTime time.Time `json:"lastMessagePostTime"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` SubscribersTextSuffix string `json:"subscribersTextSuffix"` SubscribersName string `json:"subscribersName"` FriendsAlsoSubscribe string `json:"friendsAlsoSubscribe"` Maintainer json.RawMessage `json:"maintainer"` IsUserTopicAdmin bool `json:"isUserTopicAdmin"` ActivitySection json.RawMessage `json:"activitySection"` ActivitySections json.RawMessage `json:"activitySections"` Tips Tips `json:"tips"` ToppingArea json.RawMessage `json:"toppingArea"` InShortcuts bool `json:"inShortcuts"` PreferSection string `json:"preferSection"` Intro string `json:"intro"` SquarePostUpdateTime time.Time `json:"squarePostUpdateTime"` SubscribersAction string `json:"subscribersAction"` ApproximateSubscribersCount string `json:"approximateSubscribersCount"` SubscribersDescription string `json:"subscribersDescription"` IsCommentForbidden bool `json:"isCommentForbidden"` BotCount int `json:"botCount"` RecentPost string `json:"recentPost"` Source string `json:"source"` EnableForUserPost bool `json:"enableForUserPost"` }
type UploadTokenReq ¶
type UploadTokenReq struct {
// contains filtered or unexported fields
}
func NewUploadTokenReq ¶
func NewUploadTokenReq(name string, ut UploadType) (*UploadTokenReq, error)
func (*UploadTokenReq) Map ¶
func (utr *UploadTokenReq) Map() map[string]string
type UploadTokenRsp ¶
type UploadTokenRsp struct {
UpToken string `json:"uptoken"`
}
type User ¶
type User struct { Id string `json:"id"` Username string `json:"username"` ScreenName string `json:"screenName"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` IsVerified bool `json:"isVerified"` VerifyMessage string `json:"verifyMessage"` BriefIntro string `json:"briefIntro"` AvatarImage AvatarImage `json:"avatarImage"` Decorations Decorations `json:"decorations"` ProfileImageUrl string `json:"profileImageUrl"` StatsCount StatsCount `json:"statsCount"` IsBannedForever bool `json:"isBannedForever"` IsSponsor bool `json:"isSponsor"` BackgroundImage BackgroundImage `json:"backgroundImage"` Bio string `json:"bio"` Gender string `json:"gender"` Preferences Preferences `json:"preferences"` IsBetaUser bool `json:"isBetaUser"` UsernameSet bool `json:"usernameSet"` WechatOpenId string `json:"wechatOpenId"` WechatUnionId string `json:"wechatUnionId"` QqOpenId string `json:"qqOpenId"` MobilePhoneNumber string `json:"mobilePhoneNumber"` AreaCode string `json:"areaCode"` Birthday string `json:"birthday"` QqUserInfo QqUserInfo `json:"qqUserInfo"` TopicRoles json.RawMessage `json:"topicRoles"` School School `json:"school"` Zodiac string `json:"zodiac"` RelationshipState RelationshipState `json:"relationshipState"` ShowRespect bool `json:"showRespect"` Medals json.RawMessage `json:"medals"` ProfileTags []ProfileTag `json:"profileTags"` BackgroundMaskColor string `json:"backgroundMaskColor"` IsLoginUser bool `json:"isLoginUser"` IsBanned bool `json:"isBanned"` UserHasPosted bool `json:"userHasPosted"` HasStories bool `json:"hasStories"` RestrictedAvatarChange RestrictedAvatarChange `json:"restrictedAvatarChange"` RestrictedNameChange RestrictedNameChange `json:"restrictedNameChange"` IsDefaultScreenName bool `json:"isDefaultScreenName"` ProfileVisitInfo ProfileVisitInfo `json:"profileVisitInfo"` }
Click to show internal directories.
Click to hide internal directories.