Documentation
¶
Index ¶
- Variables
- type Avatar
- type CurrentUser
- type Error
- type FriendStatus
- type InstanceId
- type InviteRequest
- type InviteResponse
- type LimitedUser
- type Message
- type MessageType
- type Notification
- type Privacy
- type Region
- type RequestInviteRequest
- type SentNotification
- type Session
- func (s *Session) Auth(login, password, twoFactorSecret string) error
- func (s *Session) CheckFriendStatus(userId string) (response FriendStatus, err error)
- func (s *Session) DeleteFriendRequest(userId string) (response Success, err error)
- func (s *Session) GetInstance(worldId string, instanceId InstanceId) error
- func (s *Session) GetInviteMessages(userId string, messageType MessageType, slot int) (response Message, err error)
- func (s *Session) GetOwnAvatar(userId string) (response *Avatar, err error)
- func (s *Session) InitUser() error
- func (s *Session) InstanceLaunch(worldId string, instanceId InstanceId) error
- func (s *Session) InviteMySelf(instanceId string) (response SentNotification, err error)
- func (s *Session) InviteUser(instanceId, userId string) (response InviteResponse, err error)
- func (s *Session) ListFriends(userId string) (response LimitedUser, err error)
- func (s *Session) ListInviteMessages(userId string, messageType MessageType) (response []Message, err error)
- func (s *Session) RequestInvite(userId string) (response Notification, err error)
- func (s *Session) ResetInviteMessage(userId string, messageType MessageType, slot int) (response []Message, err error)
- func (s *Session) RespondInvite(notifyId string) (response Notification, err error)
- func (s *Session) SendFriendRequest(userId string) (response Notification, err error)
- func (s *Session) TwoFactorAuth(twoFactorSecret string) error
- func (s *Session) Unfriend(userId string) (response Success, err error)
- func (s *Session) UpdateInviteMessage(userId string, messageType MessageType, slot int, message string) (response []Message, err error)
- type Success
- type TwoFactorAuthCode
- type UpdateInviteMessageRequest
- type Verify2FAResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EndpointVRC = "https://vrchat.com/" EndpointAPI = "https://api.vrchat.cloud/api/1/" EndpointLogin = EndpointAPI + "auth/user" Endpoint2FA = EndpointAPI + "auth/twofactorauth/totp/verify" EndpointGetInstance = func(worldId string, instanceId InstanceId) string { return EndpointAPI + "instances/" + worldId + ":" + instanceId.String() } EndpointInstance = func(worldId string, instanceId InstanceId) string { return EndpointAPI + "instances/" + worldId + ":" + instanceId.String() } // EndpointInstanceLaunch https://vrchatapi.github.io/tutorials/instances/ EndpointInstanceLaunch = func(worldId string, instanceId InstanceId) string { return EndpointVRC + "home/launch?" + "worldId=" + worldId + "&" + "instanceId=" + instanceId.String() } EndpointInviteUser = func(userId string) string { return EndpointAPI + "invite/" + userId } EndpointInviteMyself = func(instance string) string { return EndpointAPI + "invite/myself/to/" + instance } EndpointRequestInvite = func(userId string) string { return EndpointAPI + "requestInvite/" + userId } EndpointRespondInvite = func(notifyId string) string { return EndpointAPI + "invite/" + notifyId + "/response" } EndpointListInviteMessages = func(userId string, messageType MessageType) string { return EndpointAPI + "message/" + userId + "/" + string(messageType) } EndpointGetInviteMessage = func(userId string, messageType MessageType, slot int) string { return EndpointAPI + "message/" + userId + "/" + string(messageType) + "/" + strconv.Itoa(slot) } EndpointUpdateInviteMessage = func(userId string, messageType MessageType, slot int) string { return EndpointAPI + "message/" + userId + "/" + string(messageType) + "/" + strconv.Itoa(slot) } EndpointResetInviteMessage = func(userId string, messageType MessageType, slot int) string { return EndpointAPI + "message/" + userId + "/" + string(messageType) + "/" + strconv.Itoa(slot) } EndpointGetOwnAvatar = func(userID string) string { return EndpointAPI + "user/" + userID + "/avatar" } EndpointListFriends = EndpointAPI + "auth/user/friends?offline=true" EndpointFriendRequest = func(userID string) string { return EndpointAPI + "user/" + userID + "/friendRequest" } EndpointCheckFriendStatus = func(userID string) string { return EndpointAPI + "user/" + userID + "/friendStatus" } EndpointUnfriend = func(userID string) string { return EndpointAPI + "auth/user/friends/" + userID } )
Functions ¶
This section is empty.
Types ¶
type Avatar ¶
type Avatar struct { AssetUrl string `json:"assetUrl"` AssetUrlObject struct { } `json:"assetUrlObject"` AuthorId string `json:"authorId"` AuthorName string `json:"authorName"` CreatedAt time.Time `json:"created_at"` Description string `json:"description"` Featured bool `json:"featured"` Id string `json:"id"` ImageUrl string `json:"imageUrl"` Name string `json:"name"` ReleaseStatus string `json:"releaseStatus"` Tags []string `json:"tags"` ThumbnailImageUrl string `json:"thumbnailImageUrl"` UnityPackageUrl string `json:"unityPackageUrl"` UnityPackages []struct { AssetUrl string `json:"assetUrl"` AssetUrlObject struct { } `json:"assetUrlObject"` AssetVersion int `json:"assetVersion"` CreatedAt time.Time `json:"created_at"` Id string `json:"id"` Platform string `json:"platform"` PluginUrl string `json:"pluginUrl"` PluginUrlObject struct { } `json:"pluginUrlObject"` UnitySortNumber int64 `json:"unitySortNumber"` UnityVersion string `json:"unityVersion"` } `json:"unityPackages"` UpdatedAt time.Time `json:"updated_at"` Version int `json:"version"` }
type CurrentUser ¶
type CurrentUser struct { AcceptedTOSVersion int `json:"acceptedTOSVersion"` AcceptedPrivacyVersion int `json:"acceptedPrivacyVersion"` AccountDeletionDate string `json:"accountDeletionDate"` AccountDeletionLog []struct { Message string `json:"message"` DeletionScheduled time.Time `json:"deletionScheduled"` DateTime time.Time `json:"dateTime"` } `json:"accountDeletionLog"` ActiveFriends []string `json:"activeFriends"` AllowAvatarCopying bool `json:"allowAvatarCopying"` Bio string `json:"bio"` BioLinks []string `json:"bioLinks"` CurrentAvatar string `json:"currentAvatar"` CurrentAvatarAssetUrl string `json:"currentAvatarAssetUrl"` CurrentAvatarImageUrl string `json:"currentAvatarImageUrl"` CurrentAvatarThumbnailImageUrl string `json:"currentAvatarThumbnailImageUrl"` CurrentAvatarTags []string `json:"currentAvatarTags"` DateJoined string `json:"date_joined"` DeveloperType string `json:"developerType"` DisplayName string `json:"displayName"` EmailVerified bool `json:"emailVerified"` FallbackAvatar string `json:"fallbackAvatar"` FriendKey string `json:"friendKey"` Friends []string `json:"friends"` HasBirthday bool `json:"hasBirthday"` HideContentFilterSettings bool `json:"hideContentFilterSettings"` UserLanguage string `json:"userLanguage"` UserLanguageCode string `json:"userLanguageCode"` HasEmail bool `json:"hasEmail"` HasLoggedInFromClient bool `json:"hasLoggedInFromClient"` HasPendingEmail bool `json:"hasPendingEmail"` HomeLocation string `json:"homeLocation"` Id string `json:"id"` IsFriend bool `json:"isFriend"` LastActivity time.Time `json:"last_activity"` LastLogin time.Time `json:"last_login"` LastPlatform string `json:"last_platform"` ObfuscatedEmail string `json:"obfuscatedEmail"` ObfuscatedPendingEmail string `json:"obfuscatedPendingEmail"` OculusId string `json:"oculusId"` GoogleId string `json:"googleId"` PicoId string `json:"picoId"` ViveId string `json:"viveId"` OfflineFriends []string `json:"offlineFriends"` OnlineFriends []string `json:"onlineFriends"` PastDisplayNames []struct { DisplayName string `json:"displayName"` UpdatedAt time.Time `json:"updated_at"` } `json:"pastDisplayNames"` Presence struct { AvatarThumbnail string `json:"avatarThumbnail"` DisplayName string `json:"displayName"` Groups []string `json:"groups"` Id string `json:"id"` Instance string `json:"instance"` InstanceType string `json:"instanceType"` IsRejoining string `json:"isRejoining"` Platform string `json:"platform"` ProfilePicOverride string `json:"profilePicOverride"` Status string `json:"status"` TravelingToInstance string `json:"travelingToInstance"` TravelingToWorld string `json:"travelingToWorld"` World string `json:"world"` } `json:"presence"` ProfilePicOverride string `json:"profilePicOverride"` State string `json:"state"` Status string `json:"status"` StatusDescription string `json:"statusDescription"` StatusFirstTime bool `json:"statusFirstTime"` StatusHistory []string `json:"statusHistory"` SteamDetails struct { } `json:"steamDetails"` SteamId string `json:"steamId"` Tags []string `json:"tags"` TwoFactorAuthEnabled bool `json:"twoFactorAuthEnabled"` TwoFactorAuthEnabledDate time.Time `json:"twoFactorAuthEnabledDate"` Unsubscribe bool `json:"unsubscribe"` UpdatedAt time.Time `json:"updated_at"` UserIcon string `json:"userIcon"` }
type FriendStatus ¶
type InstanceId ¶
func (*InstanceId) String ¶
func (i *InstanceId) String() string
type InviteRequest ¶
type InviteResponse ¶
type InviteResponse struct {
MessageSlot int `json:"messageSlot"`
}
type LimitedUser ¶
type LimitedUser struct { Bio string `json:"bio"` CurrentAvatarImageUrl string `json:"currentAvatarImageUrl"` CurrentAvatarThumbnailImageUrl string `json:"currentAvatarThumbnailImageUrl"` DeveloperType string `json:"developerType"` DisplayName string `json:"displayName"` FallbackAvatar string `json:"fallbackAvatar"` Id string `json:"id"` IsFriend bool `json:"isFriend"` LastPlatform string `json:"last_platform"` ProfilePicOverride string `json:"profilePicOverride"` Status string `json:"status"` StatusDescription string `json:"statusDescription"` Tags []string `json:"tags"` UserIcon string `json:"userIcon"` Location string `json:"location"` FriendKey string `json:"friendKey"` }
type MessageType ¶
type MessageType string
const ( DefaultMessage MessageType = "message" Response MessageType = "response" Request MessageType = "request" RequestResponse MessageType = "requestResponse" )
type Notification ¶
type RequestInviteRequest ¶
type RequestInviteRequest struct {
MessageSlot int `json:"messageSlot"`
}
type SentNotification ¶
type Session ¶
type Session struct { Client *http.Client User *CurrentUser }
func (*Session) CheckFriendStatus ¶
func (s *Session) CheckFriendStatus(userId string) (response FriendStatus, err error)
func (*Session) DeleteFriendRequest ¶
func (*Session) GetInstance ¶
func (s *Session) GetInstance(worldId string, instanceId InstanceId) error
func (*Session) GetInviteMessages ¶
func (*Session) GetOwnAvatar ¶
func (*Session) InstanceLaunch ¶
func (s *Session) InstanceLaunch(worldId string, instanceId InstanceId) error
func (*Session) InviteMySelf ¶
func (s *Session) InviteMySelf(instanceId string) (response SentNotification, err error)
func (*Session) InviteUser ¶
func (s *Session) InviteUser(instanceId, userId string) (response InviteResponse, err error)
func (*Session) ListFriends ¶
func (s *Session) ListFriends(userId string) (response LimitedUser, err error)
func (*Session) ListInviteMessages ¶
func (s *Session) ListInviteMessages(userId string, messageType MessageType) (response []Message, err error)
func (*Session) RequestInvite ¶
func (s *Session) RequestInvite(userId string) (response Notification, err error)
func (*Session) ResetInviteMessage ¶
func (*Session) RespondInvite ¶
func (s *Session) RespondInvite(notifyId string) (response Notification, err error)
func (*Session) SendFriendRequest ¶
func (s *Session) SendFriendRequest(userId string) (response Notification, err error)
func (*Session) TwoFactorAuth ¶
func (*Session) UpdateInviteMessage ¶
type TwoFactorAuthCode ¶
type TwoFactorAuthCode struct {
Code string `json:"code"`
}
type UpdateInviteMessageRequest ¶
type UpdateInviteMessageRequest struct {
Message string `json:"message"`
}
type Verify2FAResult ¶
type Verify2FAResult struct {
Verified bool `json:"verified"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.