Documentation
¶
Index ¶
- Constants
- Variables
- type AIExam
- type APIErrorMessage
- type Badge
- type CenterBackgroundData
- type Charm
- type CommonService
- type ContentFeedBanner
- type ContentVoice
- type Credentials
- type DecorationPendantData
- type DecorationProfileCardData
- type Device
- type EntrySpecialEffectData
- type ExamBean
- type ExternalBean
- type ExtraInfo
- type Family
- type Feed
- type FeedRecommend
- type FeedRecommendList
- type FeedService
- type FollowRecommend
- type Gravity
- type GravityConfig
- type GravityOption
- type HashtagList
- type InterestTag
- type InternalBean
- type IsEmailRegisteredParams
- type IsPhoneNumberRegisteredParams
- type LoginData
- type LoginWithEmailParams
- type MBTIExam
- type PortraitData
- type PortraitFrame
- type RESTError
- type RecommendFeedListParams
- type RecommendUsers
- type Setting
- type SnsInfo
- type Star
- type State
- type StorageService
- type UserAuth
- type UserFans
- type UserInfo
- type UserMessageBubble
- type UserService
- type UserTagData
- type VIPInfo
- type VoiceMicrophoneData
Constants ¶
View Source
const ( KEY = "baisimeji9262019" IV = "qrstuvwxyz123456" T_SECRET = 999983 )
View Source
const VERSION = "0.0.0"
VERSION of Go Gravity
Variables ¶
View Source
var ( EndpointRoot = "https://api.gravity.place/gravity/" EndpointCommon = EndpointRoot + "common/" EndpointFeed = EndpointRoot + "feed/" EndpointUser = EndpointRoot + "user/" EndpointCommonRegisterType = EndpointCommon + "registerFaq" EndpointCommonSendMessage = EndpointCommon + "sendMessage" EndpointCommonSystemUpgrade = EndpointCommon + "systemUpgrade" EndpointCommonGetImpornWord = EndpointCommon + "getimpornword" EndpointCommonUploadVoiceChatInfo = EndpointCommon + "uploadVoiceChatInfo" EndpointCommonUploadLog = EndpointCommon + "uploadLog" EndpointCommonUploadCheck = EndpointCommon + "uploadCheck" EndpointCommonUploadChunk = EndpointCommon + "uploadChunk" EndpointCommonNewUploadV2 = EndpointCommon + "newUploadV2" EndpointCommonAppeal = EndpointCommon + "appeal" EndpointCommonQrcode = EndpointCommon + "qrcode" EndpointCommonGetUserCountryFunctionSwitchConfig = EndpointCommon + "getUserCountryFunctionSwitchConfig" EndpointFeedFollowRecommendList = EndpointFeed + "followRecommendList" EndpointFeedRecommendForStar = EndpointFeed + "recommendForStar" EndpointFeedNewFeedListForStar = EndpointFeed + "newFeedListForStar" EndpointFeedListCommentReply = EndpointFeed + "listCommentReply" EndpointFeedAddCommentReply = EndpointFeed + "addCommentReply" EndpointFeedVoteOption = EndpointFeed + "voteOption" EndpointFeedVote = EndpointFeed + "vote" EndpointFeedAddComment = EndpointFeed + "addComment" EndpointFeedHashtagUserRank = EndpointFeed + "hashtagUserRank" EndpointFeedCloseFollowRecommendCard = EndpointFeed + "closeFollowRecommendCard" EndpointFeedGetHashtagDetail = EndpointFeed + "getHashtagDetail" EndpointFeedCollect = EndpointFeed + "collect" EndpointFeedFollowHighLightTag = EndpointFeed + "followHighLightTag" EndpointFeedSetCommentTop = EndpointFeed + "setCommentTop" EndpointFeedDeleteComment = EndpointFeed + "deleteComment" EndpointFeedGetFollowHighLightTag = EndpointFeed + "getFollowHighLightTag" EndpointFeedDeleteFeed = EndpointFeed + "deleteFeed" EndpointFeedListComment = EndpointFeed + "listComment" EndpointFeedShieldFeed = EndpointFeed + "shieldFeed" EndpointFeedShieldReason = EndpointFeed + "shieldReason" EndpointFeedShieldTag = EndpointFeed + "shieldTag" EndpointFeedGetFeedById = EndpointFeed + "getFeedById" EndpointFeedListHotComment = EndpointFeed + "listHotComment" EndpointFeedRecommendFeedListV2 = EndpointFeed + "recommendFeedListV2" EndpointFeedNewFeedListV2 = EndpointFeed + "newFeedListV2" EndpointFeedPalFeedListV3 = EndpointFeed + "palFeedListV3" EndpointFeedGetDefaultText = EndpointFeed + "getDefaultText" EndpointFeedActivityList = EndpointFeed + "activityList" EndpointFeedActivitySummary = EndpointFeed + "activitySummary" EndpointFeedGuide = EndpointFeed + "guide" EndpointFeedHashtagDel = EndpointFeed + "hashtagDel" EndpointFeedHashtag = EndpointFeed + "hashtag" EndpointFeedPredictTagv2 = EndpointFeed + "predictTagv2" EndpointFeedUploadFeed = EndpointFeed + "uploadFeed" EndpointFeedDelHashAndInterestTagHis = EndpointFeed + "delHashAndInterestTagHis" EndpointFeedHashAndInterestTagHis = EndpointFeed + "hashAndInterestTagHis" EndpointFeedHashAndInterestTag = EndpointFeed + "hashAndInterestTag" EndpointFeedSearchHis = EndpointFeed + "searchHis" EndpointFeedAddHashAndInterestTagHis = EndpointFeed + "addHashAndInterestTagHis" EndpointFeedAddShieldKeyword = EndpointFeed + "addShieldKeyword" EndpointFeedDelShieldKeyword = EndpointFeed + "delShieldKeyword" EndpointFeedListShieldKeyword = EndpointFeed + "listShieldKeyword" EndpointFeedSetTop = EndpointFeed + "setTop" EndpointFeedPersonalFeedList = EndpointFeed + "personalFeedList" EndpointUserVirtual3DStatusDiaryList = EndpointUser + "virtual3DStatusDiaryList" EndpointUserVirtual3DEmojiConfigList = EndpointUser + "virtual3DEmojiConfigList" EndpointUserVirtual3DPropStatusForSquare = EndpointUser + "virtual3DPropStatusForSquare" EndpointUserVirtual3DReceiveRewards = EndpointUser + "virtual3DReceiveRewards" EndpointUserVirtual3DShortInfoList = EndpointUser + "virtual3DShortInfoList" EndpointUserUserListInfo = EndpointUser + "userListInfo" EndpointUserUpdateSeeking = EndpointUser + "updateSeeking" EndpointUserCheckCode = EndpointUser + "checkCode" EndpointUserGetSeeking = EndpointUser + "getSeeking" EndpointUserHofUserList = EndpointUser + "HofUserList" EndpointUserThirdLogin = EndpointUser + "third/login" EndpointUserBindEmail = EndpointUser + "email/bindEmail" EndpointUserBindCode = EndpointUser + "bindCode" EndpointUserCheckInstall = EndpointUser + "checkInstall" EndpointUserCheckRegister = EndpointUser + "checkRegister" EndpointUserEmailIsBind = EndpointUser + "email/isbind" EndpointUserEmailIsRegistered = EndpointUser + "email/isreg" EndpointUserInterestClassify = EndpointUser + "interestClassify" EndpointUserEmailLogin = EndpointUser + "email/login" EndpointUserLoginWithCode = EndpointUser + "loginWithCode" EndpointUserMobileIsRegistered = EndpointUser + "mobile/isreg" EndpointUserEmailSendMsg = EndpointUser + "email/sendmsg" EndpointUserAccountLogOffMsg = EndpointUser + "account/logOffMsg" EndpointUserAccountLogOff = EndpointUser + "account/logOff" EndpointUserIsRaisePopup = EndpointUser + "isRaisePopup" EndpointUserUpdateDevice = EndpointUser + "updateDevice" EndpointUserUpdateSetting = EndpointUser + "updateSetting" EndpointUserGetCenterBackground = EndpointUser + "getCenterBackground" EndpointUserUpdateMicrophoneColor = EndpointUser + "updateMicrophoneColor" EndpointUserGetMicrophoneColor = EndpointUser + "getMicrophoneColor" EndpointUserGetEntryEffects = EndpointUser + "getEntryEffects" EndpointUserGetProfileCardDecorationList = EndpointUser + "getProfileCardDecorationList" EndpointUserGetFeedPendantList = EndpointUser + "getFeedPendantList" EndpointUserUpdateCenterBackground = EndpointUser + "updateCenterBackground" EndpointUserUpdateEntryEffects = EndpointUser + "updateEntryEffects" EndpointUserUpdateProfileCardDecoration = EndpointUser + "updateProfileCardDecoration" EndpointUserUpdateFeedPendant = EndpointUser + "updateFeedPendant" EndpointUserPortraitListCount = EndpointUser + "portraitListCount" EndpointUserUpdateTag = EndpointUser + "updateTag" EndpointUserUpdateUserInfo = EndpointUser + "updateUserInfo" EndpointUserSecondHomePage = EndpointUser + "secondHomePage" EndpointUserUpdateSnsInfo = EndpointUser + "updateSnsInfo" EndpointUserExtraInfo = EndpointUser + "extraInfo" EndpointUserGetInterestTag = EndpointUser + "getInterestTag" EndpointUserDressUpCenter = EndpointUser + "dressUpCenter" EndpointUserUserInfoCenter = EndpointUser + "userInfoCenter" EndpointUserUserDetail = EndpointUser + "detail" EndpointUserSettingCenter = EndpointUser + "settingCenter" EndpointUserWhiteListCheck = EndpointUser + "whiteListCheck" )
View Source
var ( ErrInvalidIdentifier = errors.New("not a valid identifier given") ErrStorageDoesNotMatch = errors.New("storage does not match given credentials") ErrAuthenticationFailed = errors.New("authentication failed") )
View Source
var ( ErrNoInvalidParams = -3 ErrNoSignCheckFailed = -4 ErrNoSuccess = 0 ErrNoEmailAddressOrPassword = 50012 ErrNoEmailAddressNotRegistered = 50014 )
View Source
var ( // Marshal defines function used to encode JSON payloads Marshal func(v interface{}) ([]byte, error) = json.Marshal // Unmarshal defines function used to decode JSON payloads Unmarshal func(src []byte, v interface{}) error = json.Unmarshal )
View Source
var ( LoginTypeInvalid = -1 LoginTypeOther = 0 LoginTypePnum = 1 LoginTypeEmail = 2 )
View Source
var (
ErrJSONUnmarshal = errors.New("json unmarshal")
)
All error constants
Functions ¶
This section is empty.
Types ¶
type APIErrorMessage ¶
type CenterBackgroundData ¶
type CenterBackgroundData struct {
ActivityBeginTime int64 `json:"activity_begin_time"`
ActivityEndTime int64 `json:"activity_end_time"`
AndroidUrl string `json:"android_url"`
Anim string `json:"anim"`
Count int `json:"count"`
ExpireTime int64 `json:"expire_time"`
GetStatus int `json:"is_get"`
GoodsType int `json:"goods_type"`
ID int `json:"id"`
Image string `json:"image"`
Level string `json:"level"`
Name string `json:"name"`
Preview string `json:"preview"`
TagType string `json:"tag_type"`
ValidDays int `json:"valid_days"`
VipLevel int `json:"vip_level"`
}
type CommonService ¶
type CommonService struct {
// contains filtered or unexported fields
}
func (*CommonService) SaySomething ¶
func (s *CommonService) SaySomething(msg string)
type ContentFeedBanner ¶
type ContentFeedBanner struct{}
type ContentVoice ¶
type ContentVoice struct{}
type Credentials ¶
type DecorationPendantData ¶
type DecorationPendantData struct {
ActivityBeginTime int64 `json:"activity_begin_time"`
ActivityEndTime int64 `json:"activity_end_time"`
ActivitySource int64 `json:"activity_source"`
AndroidURL string `json:"android_url"`
Count int `json:"count"`
Desc string `json:"desc"`
ExpireTime int64 `json:"expire_time"`
GoodsType int `json:"goods_type"`
ID int `json:"id"`
IsGet int `json:"is_get"`
Level string `json:"level"`
Name string `json:"name"`
PendantUrl string `json:"pendant_url"`
PreviewURL string `json:"preview_url"`
ValidDays string `json:"valid_days"`
VipLevel int `json:"vip_level"`
}
type DecorationProfileCardData ¶
type DecorationProfileCardData struct{}
type Device ¶
type Device struct {
SimCountry string `json:"sim_country"`
Device string `json:"device"`
SystemVersion string `json:"system_version"`
Sign string `json:"sign"`
Referrer string `json:"referrer"`
Zone string `json:"zone"`
IDFA string `json:"idfa"`
AppVersionCode string `json:"app_version_code"`
Timestamp string `json:"ts"`
SystemLanguage string `json:"sys_lang"`
AppVersion string `json:"app_version"`
LanguageV2 string `json:"languageV2"`
UWD string `json:"uwd"`
Country string `json:"country"`
Brand string `json:"brand"`
SDKVersion string `json:"sdk_version"`
UserCountry string `json:"user_country"`
Package string `json:"pkg"`
Product string `json:"product"`
Model string `json:"model"`
}
type EntrySpecialEffectData ¶
type EntrySpecialEffectData struct {
ActivityBeginTime int64 `json:"activity_begin_time"`
ActivityEndTime int64 `json:"activity_end_time"`
ActivitySource string `json:"activity_source"`
AndroidURL string `json:"android_url"`
ColorValue string `json:"color_value"`
Count int `json:"count"`
EntryDesc string `json:"entry_desc"`
EntryURL string `json:"entry_url"`
ExpireTime int64 `json:"expire_time"`
GoodsType int `json:"goods_type"`
ID int `json:"id"`
IsGet int `json:"is_get"`
Level string `json:"level"`
Name string `json:"name"`
PreviewURL string `json:"preview_url"`
ValidDays string `json:"valid_days"`
VideoURL string `json:"video_url"`
VipLevel int `json:"vip_level"`
}
type ExamBean ¶
type ExamBean struct {
AIExam AIExam `json:"ai_exam"`
External ExternalBean `json:"external"`
Internal InternalBean `json:"internal"`
MBTIExam MBTIExam `json:"mbti_exam"`
}
type ExternalBean ¶
type ExtraInfo ¶
type ExtraInfo struct {
CenterBackground CenterBackgroundData `json:"center_background"`
CharacterAttribute string `json:"character_attribute"`
Charm Charm `json:"charm_info"`
CreatorStatus int `json:"creator_status"`
EntryEffects EntrySpecialEffectData `json:"entry_effects"`
Exam ExamBean `json:"exam"`
Family Family `json:"family"`
Fans int `json:"fans"`
Follow int `json:"follow"`
Friends int `json:"friends"`
GoodAnchorStatus int `json:"voice_creator_status"`
GuardStatus int `json:"guard_status"`
HasDeepFriend int `json:"is_widget"`
HaveVoiceUserTag int `json:"have_voice_user_tag"`
InterestTag []InterestTag `json:"interest_tag"`
IsIn3D int `json:"is_in_3D"`
IsPlato int `json:"is_plato"`
MessageBubble UserMessageBubble `json:"message_bubble"`
MicrophoneInfo VoiceMicrophoneData `json:"microphone_info"`
Mute int `json:"behavior"`
OnlineStatus int `json:"online_status"`
Pendant DecorationPendantData `json:"feed_pendant"`
PortraitFrame PortraitFrame `json:"portrait_frame"`
PortraitInfo PortraitData `json:"portrait_info"`
ProfileCard DecorationProfileCardData `json:"profile_card_decoration"`
RecallUser int `json:"recall_user"`
Relation int `json:"relation"`
RelationType int `json:"relation_type"`
Setting Setting `json:"setting"`
ShowLotteryNewUserGuide int `json:"user_is_lottery_new"`
SnsInfo SnsInfo `json:"sns_info"`
SquareUpdateTime int64 `json:"square_update_time"`
UserAuth UserAuth `json:"user_authority"`
UserTagData []UserTagData `json:"user_tag_list"`
UserStatistic UserFans `json:"user_statistic"`
VIP VIPInfo `json:"vip"`
VirtualBG string `json:"virtual_bg"`
VirtualBGImage string `json:"bg_img"`
VirtualImage string `json:"virtualImage"`
VoiceChannelId string `json:"voice_channel_id"`
VoiceOnline int `json:"voice_online"`
VoiceUserTag UserTagData `json:"voice_user_tag"`
}
type FeedRecommend ¶
type FeedRecommend struct {
ContentFeed Feed `json:"content_feed"`
ContentFeedBanner ContentFeedBanner `json:"content_feed_banner"`
ContentFeedGuide map[string]string `json:"content_feed_guide"`
RecommendUsers RecommendUsers `json:"content_user"`
ContentVoice ContentVoice `json:"content_voice"`
FollowRecommend FollowRecommend `json:"follow_recommend"`
StarInfo Star `json:"star_info"`
Type string `json:"type"`
}
type FeedRecommendList ¶
type FeedRecommendList struct {
HashtagList HashtagList `json:"high_tag"`
HcInfo string `json:"hc_info"`
IsNew int `json:"is_new"`
LastID string `json:"last_id"`
List []FeedRecommend `json:"list"`
TagID string `json:"tag_id"`
Type string `json:"type"`
}
type FeedService ¶
type FeedService struct {
// contains filtered or unexported fields
}
func (*FeedService) RecommendFeedList ¶
func (s *FeedService) RecommendFeedList(params *RecommendFeedListParams) (st interface{}, err error)
type FollowRecommend ¶
type FollowRecommend struct{}
type Gravity ¶
type Gravity struct {
Common *CommonService
Feed *FeedService
Storage *StorageService
User *UserService
// contains filtered or unexported fields
}
type GravityConfig ¶
type GravityConfig struct {
// contains filtered or unexported fields
}
type GravityOption ¶
type GravityOption func(cfg *GravityConfig)
func WithClient ¶
func WithClient(client *http.Client) GravityOption
WithClient changes the HTTP client used for the request.
func WithStorageFilename ¶
func WithStorageFilename(filename string) GravityOption
WithStorageFilename changes the filename used for the storage.
type HashtagList ¶
type HashtagList struct {
}
type InterestTag ¶
type InternalBean ¶
type IsEmailRegisteredParams ¶
type IsEmailRegisteredParams struct {
Address string `json:"address"`
}
type IsPhoneNumberRegisteredParams ¶
type IsPhoneNumberRegisteredParams struct {
Number string `json:"pnum"`
}
type LoginWithEmailParams ¶
type PortraitData ¶
type PortraitData struct{}
type PortraitFrame ¶
type PortraitFrame struct {
ExpireTime int64 `json:"expire_time"`
FrameID int `json:"frame_id"`
FrameImage string `json:"frame_image"`
FrameType int `json:"frame_type"`
HideStyle int `json:"is_hide"`
LimitNum int `json:"limit_num"`
LimitSerialNum int `json:"limit_serial_num"`
LimitStatus int `json:"limit_status"`
PortraitFrameLevel string `json:"portrait_frame_level"`
PortraitFrameName string `json:"portrait_frame_name"`
}
type RESTError ¶
type RESTError struct {
Request *http.Request
Response *http.Response
ResponseBody []byte
Message *APIErrorMessage // Message may be nil.
}
RESTError stores error information about a request with a bad response code. Message is not always present, there are cases where api calls can fail without returning a json message.
type RecommendFeedListParams ¶
type RecommendUsers ¶
type RecommendUsers struct{}
type StorageService ¶
type StorageService struct {
// contains filtered or unexported fields
}
func (*StorageService) CreateOneAndSave ¶
func (s *StorageService) CreateOneAndSave() error
func (*StorageService) Load ¶
func (s *StorageService) Load() (err error)
load() transports local storage data into Gravity.State. If Gravity.State doesn't match the local straage, returns an error.
func (*StorageService) Remove ¶
func (s *StorageService) Remove() error
func (*StorageService) Save ¶
func (s *StorageService) Save() error
save() exports current Gravity.State as local storage data
type UserInfo ¶
type UserInfo struct {
AnchorLevel string `json:"anchor_level"`
AnchorLevelBadgeURL string `json:"anchor_level_badge_url"`
AnchorLevelURL string `json:"anchor_level_url"`
BadgeList []Badge `json:"badge_list"`
BadgeListWall []Badge `json:"badge_list_wall"`
Birthdate int `json:"birthdate"`
Center2DBackground string `json:"2d_bg_img"`
CrownRank int `json:"crown_rank"`
CustomID string `json:"custom_id"`
EncrypUserID string `json:"encryp_user_id"`
EncryptEmail string `json:"encrypt_email"`
Ext ExtraInfo `json:"ext"`
Gender int `json:"gender"`
IsOld3D int `json:"is_3D"`
LoginType int `json:"login_type"`
Name string `json:"name"`
PlatoGender int `json:"plato_gender"`
Portrait string `json:"portrait"`
PortraitFrame string `json:"portrait_frame"`
Profile string `json:"profile"`
RegisterTime int `json:"db_time"`
RegisterVersion string `json:"app_version"`
ShouldHidden int `json:"should_hidden"`
UserCountry string `json:"user_country"`
UserID float64 `json:"user_id"`
VirtualTypeV2 int `json:"virtual_type_v2"`
VoiceCreatorStatus int `json:"voice_creator_status"`
BGImg string `json:"bg_img"`
CompressPortrait string `json:"compress_portrait"`
CreatorStatus int `json:"creator_status"`
GroupLevel int `json:"group_level"`
GuardStatus int `json:"guard_status"`
IsMinor int `json:"is_minor"`
LimitSerialNum int `json:"limit_serial_num"`
LoginTime int `json:"login_time"`
LowerCustomID string `json:"lower_custom_id"`
PortraitColor string `json:"portrait_color"`
PortraitFrameExpire int `json:"portrait_frame_expire"`
PortraitFrameID int `json:"portrait_frame_id"`
PortraitImage string `json:"portrait_image"`
RefreshToken string `json:"refres_token"`
Status int `json:"status"`
VirtualImage string `json:"virtual_image"`
}
type UserMessageBubble ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
type UserTagData ¶
type UserTagData struct{}
Click to show internal directories.
Click to hide internal directories.