vrcclient

package module
v0.0.0-...-c5687ac Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidGroupCalendarCategory = fmt.Errorf("not a valid GroupCalendarCategory, try [%s]", strings.Join(_GroupCalendarCategoryNames, ", "))
View Source
var ErrInvalidLanguage = fmt.Errorf("not a valid Language, try [%s]", strings.Join(_LanguageNames, ", "))
View Source
var ErrInvalidNotificationType = fmt.Errorf("not a valid NotificationType, try [%s]", strings.Join(_NotificationTypeNames, ", "))
View Source
var ErrInvalidPlatform = fmt.Errorf("not a valid Platform, try [%s]", strings.Join(_PlatformNames, ", "))

Functions

func GroupCalendarCategoryNames

func GroupCalendarCategoryNames() []string

GroupCalendarCategoryNames returns a list of possible string values of GroupCalendarCategory.

func GroupURL

func GroupURL(id string) string

func LanguageNames

func LanguageNames() []string

LanguageNames returns a list of possible string values of Language.

func NotificationTypeNames

func NotificationTypeNames() []string

NotificationTypeNames returns a list of possible string values of NotificationType.

func PlatformNames

func PlatformNames() []string

PlatformNames returns a list of possible string values of Platform.

Types

type AuthData

type AuthData struct {
	AuthCookie  string `json:"auth_cookie" yaml:"auth_cookie"`
	TwoFACookie string `json:"two_fa_cookie" yaml:"two_fa_cookie"`
}

type Client

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

func New

func New(opts ...Option) (*Client, error)

func (*Client) AuthWith2Fa

func (c *Client) AuthWith2Fa(ctx context.Context, username, password, totpCode string) (*ClientAuth, error)

func (*Client) AuthWith2FaSecret

func (c *Client) AuthWith2FaSecret(ctx context.Context, username, password, totpSecret string) (*ClientAuth, error)

func (*Client) RestoreAuth

func (c *Client) RestoreAuth(a AuthData) *ClientAuth

type ClientAuth

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

func (*ClientAuth) CheckAuth

func (c *ClientAuth) CheckAuth(ctx context.Context) (bool, error)

func (*ClientAuth) ClearNotification

func (c *ClientAuth) ClearNotification(ctx context.Context) error

func (*ClientAuth) CurrentUser

func (c *ClientAuth) CurrentUser(ctx context.Context) (*User, error)

func (*ClientAuth) DeleteNotification

func (c *ClientAuth) DeleteNotification(ctx context.Context, notificationID string) error

func (*ClientAuth) GetAuthData

func (c *ClientAuth) GetAuthData() AuthData

func (*ClientAuth) Group

func (c *ClientAuth) Group(ctx context.Context, groupID string) (*Group, error)

func (*ClientAuth) GroupCalendar

func (c *ClientAuth) GroupCalendar(ctx context.Context, groupID string) (*GroupCalendarResponse, error)

func (*ClientAuth) GroupPosts

func (c *ClientAuth) GroupPosts(ctx context.Context, groupID string, count, offset int) (*GroupPostsResponse, error)

func (*ClientAuth) GroupSearch

func (c *ClientAuth) GroupSearch(ctx context.Context, name string, count int) (GroupSearchResponse, error)

func (*ClientAuth) Notifications

func (c *ClientAuth) Notifications(ctx context.Context) (Notifications, error)

func (*ClientAuth) User

func (c *ClientAuth) User(ctx context.Context, userID string) (*User, error)

func (*ClientAuth) UserSearch

func (c *ClientAuth) UserSearch(ctx context.Context, name string, count int) (UserSearchResponse, error)

type Group

type Group struct {
	BannerID            string     `json:"bannerId"`
	BannerURL           string     `json:"bannerURL"`
	CreatedAt           time.Time  `json:"createdAt"`
	Description         string     `json:"description"`
	Discriminator       string     `json:"discriminator"`
	IconID              string     `json:"iconId"`
	IconURL             string     `json:"iconURL"`
	ID                  string     `json:"id"`
	IsVerified          bool       `json:"isVerified"`
	JoinState           string     `json:"joinState"`
	Languages           []Language `json:"languages"`
	Links               []string   `json:"links"`
	MemberCount         int        `json:"memberCount"`
	MemberCountSyncedAt time.Time  `json:"memberCountSyncedAt"`
	MembershipStatus    string     `json:"membershipStatus"`
	Name                string     `json:"name"`
	OnlineMemberCount   int        `json:"onlineMemberCount"`
	OwnerID             string     `json:"ownerId"`
	Privacy             string     `json:"privacy"`
	Rules               string     `json:"rules"`
	ShortCode           string     `json:"shortCode"`
	Tags                []string   `json:"tags"`
}

type GroupCalendar

type GroupCalendar struct {
	ID                           string                `json:"id"`
	AccessType                   string                `json:"accessType"`
	Category                     GroupCalendarCategory `json:"category"`
	CloseInstanceAfterEndMinutes int                   `json:"closeInstanceAfterEndMinutes"`
	CreatedAt                    time.Time             `json:"createdAt"`
	DeletedAt                    *time.Time            `json:"deletedAt"`
	Description                  string                `json:"description"`
	EndsAt                       time.Time             `json:"endsAt"`
	Featured                     bool                  `json:"featured"`
	GuestEarlyJoinMinutes        int                   `json:"guestEarlyJoinMinutes"`
	HostEarlyJoinMinutes         int                   `json:"hostEarlyJoinMinutes"`
	ImageID                      string                `json:"imageID"`
	ImageURL                     string                `json:"imageURL"`
	InterestedUserCount          int                   `json:"interestedUserCount"`
	IsDraft                      bool                  `json:"isDraft"`
	Languages                    []Language            `json:"languages"`
	OwnerID                      string                `json:"ownerId"`
	Platforms                    []Platform            `json:"platforms"`
	RoleIDs                      []string              `json:"roleIds"`
	StartsAt                     time.Time             `json:"startsAt"`
	Tags                         []string              `json:"tags"`
	Title                        string                `json:"title"`
	Type                         string                `json:"type"`
	UpdatedAt                    time.Time             `json:"updatedAt"`
	UsesInstanceOverflow         bool                  `json:"usesInstanceOverflow"`
}

type GroupCalendarCategory

type GroupCalendarCategory string

GroupCalendarCategory enum. ENUM( music // Music - Music Listening & Parties. gaming // Gaming - Casual Games & Tournaments. hangout // Hangout - Meetups & Meetings. exploration // Exploring - World Hopping & Adventuring. avatars // Avatars - Avatar Trading & Showcases. film_media // Film & Media - Video Watching & Discussion. dance // Dance - Practice & Dance-offs. roleplaying // Roleplaying - Roleplay & Discussion. performance // Performance - Theatre & Live Concerts. wellness // Wellness - Fitness & Mindfulness. arts // Arts - Art Creation & Enjoyment. education // Education - Teaching & Learning. other // Other - Something Else! ).

const (
	// GroupCalendarCategoryMusic is a GroupCalendarCategory of type music.
	// Music - Music Listening & Parties.
	GroupCalendarCategoryMusic GroupCalendarCategory = "music"
	// GroupCalendarCategoryGaming is a GroupCalendarCategory of type gaming.
	// Gaming - Casual Games & Tournaments.
	GroupCalendarCategoryGaming GroupCalendarCategory = "gaming"
	// GroupCalendarCategoryHangout is a GroupCalendarCategory of type hangout.
	// Hangout - Meetups & Meetings.
	GroupCalendarCategoryHangout GroupCalendarCategory = "hangout"
	// GroupCalendarCategoryExploration is a GroupCalendarCategory of type exploration.
	// Exploring - World Hopping & Adventuring.
	GroupCalendarCategoryExploration GroupCalendarCategory = "exploration"
	// GroupCalendarCategoryAvatars is a GroupCalendarCategory of type avatars.
	// Avatars - Avatar Trading & Showcases.
	GroupCalendarCategoryAvatars GroupCalendarCategory = "avatars"
	// GroupCalendarCategoryFilmMedia is a GroupCalendarCategory of type film_media.
	// Film & Media - Video Watching & Discussion.
	GroupCalendarCategoryFilmMedia GroupCalendarCategory = "film_media"
	// GroupCalendarCategoryDance is a GroupCalendarCategory of type dance.
	// Dance - Practice & Dance-offs.
	GroupCalendarCategoryDance GroupCalendarCategory = "dance"
	// GroupCalendarCategoryRoleplaying is a GroupCalendarCategory of type roleplaying.
	// Roleplaying - Roleplay & Discussion.
	GroupCalendarCategoryRoleplaying GroupCalendarCategory = "roleplaying"
	// GroupCalendarCategoryPerformance is a GroupCalendarCategory of type performance.
	// Performance - Theatre & Live Concerts.
	GroupCalendarCategoryPerformance GroupCalendarCategory = "performance"
	// GroupCalendarCategoryWellness is a GroupCalendarCategory of type wellness.
	// Wellness - Fitness & Mindfulness.
	GroupCalendarCategoryWellness GroupCalendarCategory = "wellness"
	// GroupCalendarCategoryArts is a GroupCalendarCategory of type arts.
	// Arts - Art Creation & Enjoyment.
	GroupCalendarCategoryArts GroupCalendarCategory = "arts"
	// GroupCalendarCategoryEducation is a GroupCalendarCategory of type education.
	// Education - Teaching & Learning.
	GroupCalendarCategoryEducation GroupCalendarCategory = "education"
	// GroupCalendarCategoryOther is a GroupCalendarCategory of type other.
	// Other - Something Else!
	GroupCalendarCategoryOther GroupCalendarCategory = "other"
)

func ParseGroupCalendarCategory

func ParseGroupCalendarCategory(name string) (GroupCalendarCategory, error)

ParseGroupCalendarCategory attempts to convert a string to a GroupCalendarCategory.

func (*GroupCalendarCategory) AppendText

func (x *GroupCalendarCategory) AppendText(b []byte) ([]byte, error)

AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.

Implementations must not retain b, nor mutate any bytes within b[:len(b)].

func (GroupCalendarCategory) Description

func (c GroupCalendarCategory) Description() string

func (GroupCalendarCategory) FullName

func (c GroupCalendarCategory) FullName() string

func (GroupCalendarCategory) IsValid

func (x GroupCalendarCategory) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (GroupCalendarCategory) MarshalText

func (x GroupCalendarCategory) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (GroupCalendarCategory) String

func (x GroupCalendarCategory) String() string

String implements the Stringer interface.

func (*GroupCalendarCategory) UnmarshalText

func (x *GroupCalendarCategory) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type GroupCalendarResponse

type GroupCalendarResponse struct {
	HasNext    bool             `json:"hasNext"`
	Results    []*GroupCalendar `json:"results"`
	TotalCount int              `json:"totalCount"`
}

type GroupPost

type GroupPost struct {
	AuthorID   string    `json:"authorId"`
	CreatedAt  time.Time `json:"createdAt"`
	EditorID   string    `json:"editorId"`
	GroupID    string    `json:"groupId"`
	ID         string    `json:"id"`
	ImageID    string    `json:"imageId"`
	ImageURL   string    `json:"imageUrl"`
	RoleIDs    []string  `json:"roleIds"`
	Text       string    `json:"text"`
	Title      string    `json:"title"`
	UpdatedAt  time.Time `json:"updatedAt"`
	Visibility string    `json:"visibility"`
}

type GroupPostsResponse

type GroupPostsResponse struct {
	Posts []GroupPost `json:"posts"`
	Total int         `json:"total"`
}

type GroupSearch

type GroupSearch struct {
	BannerID         string    `json:"bannerId"`
	BannerURL        string    `json:"bannerUrl"`
	CreatedAt        time.Time `json:"createdAt"`
	Description      string    `json:"description"`
	Discriminator    string    `json:"discriminator"`
	IconID           string    `json:"iconId"`
	IconURL          string    `json:"iconUrl"`
	ID               string    `json:"id"`
	IsSearchable     bool      `json:"isSearchable"`
	MemberCount      int       `json:"memberCount"`
	MembershipStatus string    `json:"membershipStatus"`
	Name             string    `json:"name"`
	OwnerID          string    `json:"ownerId"`
	Rules            string    `json:"rules"`
	ShortCode        string    `json:"shortCode"`
	Tags             []string  `json:"tags"`
}

type GroupSearchResponse

type GroupSearchResponse []*GroupSearch

type HTTPError

type HTTPError struct {
	Code int
	Body []byte
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Language

type Language string

Language enum. ENUM( eng // English kor // 한국어 rus // Русский spa // Español por // Português zho // 中文 deu // Deutsch jpn // 日本語 fra // Français swe // Svenska nld // Nederlands pol // Polski dan // Dansk nor // Norsk ita // Italiano tha // ภาษาไทย fin // Suomi hun // Magyar ces // Čeština tur // Türkçe ara // العربية ron // Română vie // Tiếng Việt ukr // украї́нська ase // American Sign Language bfi // British Sign Language dse // Dutch Sign Language fsl // French Sign Language jsl // Japanese Sign Language kvk // Korean Sign Language ).

const (
	// LanguageEng is a Language of type eng.
	// English
	LanguageEng Language = "eng"
	// LanguageKor is a Language of type kor.
	// 한국어
	LanguageKor Language = "kor"
	// LanguageRus is a Language of type rus.
	// Русский
	LanguageRus Language = "rus"
	// LanguageSpa is a Language of type spa.
	// Español
	LanguageSpa Language = "spa"
	// LanguagePor is a Language of type por.
	// Português
	LanguagePor Language = "por"
	// LanguageZho is a Language of type zho.
	// 中文
	LanguageZho Language = "zho"
	// LanguageDeu is a Language of type deu.
	// Deutsch
	LanguageDeu Language = "deu"
	// LanguageJpn is a Language of type jpn.
	// 日本語
	LanguageJpn Language = "jpn"
	// LanguageFra is a Language of type fra.
	// Français
	LanguageFra Language = "fra"
	// LanguageSwe is a Language of type swe.
	// Svenska
	LanguageSwe Language = "swe"
	// LanguageNld is a Language of type nld.
	// Nederlands
	LanguageNld Language = "nld"
	// LanguagePol is a Language of type pol.
	// Polski
	LanguagePol Language = "pol"
	// LanguageDan is a Language of type dan.
	// Dansk
	LanguageDan Language = "dan"
	// LanguageNor is a Language of type nor.
	// Norsk
	LanguageNor Language = "nor"
	// LanguageIta is a Language of type ita.
	// Italiano
	LanguageIta Language = "ita"
	// LanguageTha is a Language of type tha.
	// ภาษาไทย
	LanguageTha Language = "tha"
	// LanguageFin is a Language of type fin.
	// Suomi
	LanguageFin Language = "fin"
	// LanguageHun is a Language of type hun.
	// Magyar
	LanguageHun Language = "hun"
	// LanguageCes is a Language of type ces.
	// Čeština
	LanguageCes Language = "ces"
	// LanguageTur is a Language of type tur.
	// Türkçe
	LanguageTur Language = "tur"
	// LanguageAra is a Language of type ara.
	// العربية
	LanguageAra Language = "ara"
	// LanguageRon is a Language of type ron.
	// Română
	LanguageRon Language = "ron"
	// LanguageVie is a Language of type vie.
	// Tiếng Việt
	LanguageVie Language = "vie"
	// LanguageUkr is a Language of type ukr.
	// украї́нська
	LanguageUkr Language = "ukr"
	// LanguageAse is a Language of type ase.
	// American Sign Language
	LanguageAse Language = "ase"
	// LanguageBfi is a Language of type bfi.
	// British Sign Language
	LanguageBfi Language = "bfi"
	// LanguageDse is a Language of type dse.
	// Dutch Sign Language
	LanguageDse Language = "dse"
	// LanguageFsl is a Language of type fsl.
	// French Sign Language
	LanguageFsl Language = "fsl"
	// LanguageJsl is a Language of type jsl.
	// Japanese Sign Language
	LanguageJsl Language = "jsl"
	// LanguageKvk is a Language of type kvk.
	// Korean Sign Language
	LanguageKvk Language = "kvk"
)

func ParseLanguage

func ParseLanguage(name string) (Language, error)

ParseLanguage attempts to convert a string to a Language.

func (*Language) AppendText

func (x *Language) AppendText(b []byte) ([]byte, error)

AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.

Implementations must not retain b, nor mutate any bytes within b[:len(b)].

func (Language) FullName

func (l Language) FullName() string

func (Language) IsValid

func (x Language) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Language) MarshalText

func (x Language) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (Language) String

func (x Language) String() string

String implements the Stringer interface.

func (*Language) UnmarshalText

func (x *Language) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type Notification

type Notification struct {
	CanDelete              bool                    `json:"canDelete"`
	Category               string                  `json:"category"`
	CreatedAt              time.Time               `json:"createdAt"`
	Data                   NotificationData        `json:"data"`
	ExpiresAt              time.Time               `json:"expiresAt"`
	ExpiryAfterSeen        int                     `json:"expiryAfterSeen"`
	ID                     string                  `json:"id"`
	IgnoreDND              bool                    `json:"ignoreDND"`
	ImageURL               string                  `json:"imageUrl"`
	IsSystem               bool                    `json:"isSystem"`
	Link                   string                  `json:"link"`
	LinkText               string                  `json:"linkText"`
	LinkTextKey            string                  `json:"linkTextKey"`
	Message                string                  `json:"message"`
	MessageKey             string                  `json:"messageKey"`
	ReceiverUserID         string                  `json:"receiverUserId"`
	RelatedNotificationsID string                  `json:"relatedNotificationsId"`
	RequireSeen            bool                    `json:"requireSeen"`
	Responses              []*NotificationResponse `json:"responses"`
	Seen                   bool                    `json:"seen"`
	SenderUserID           string                  `json:"senderUserId"`
	SenderUsername         string                  `json:"senderUsername"`
	Title                  string                  `json:"title"`
	TitleKey               string                  `json:"titleKey"`
	Type                   NotificationType        `json:"type"`
	UpdatedAt              time.Time               `json:"updatedAt"`
	Version                int                     `json:"version"`
}

type NotificationData

type NotificationData struct {
	AnnouncementTitle string `json:"announcementTitle"`
	GroupID           string `json:"groupId"`
	GroupName         string `json:"groupName"`
}

type NotificationResponse

type NotificationResponse struct {
	Data    string `json:"data"`
	Icon    string `json:"icon"`
	Text    string `json:"text"`
	TextKey string `json:"textKey"`
	Type    string `json:"type"`
}

type NotificationType

type NotificationType string

NotificationType enum. ENUM( economy.alert // Economy group.announcement // Group Announcement group.informative // Group group.invite // Group Invite group.joinRequest // Group Join Request group.post // Group Post event.announcement // Event Announcement invite.instance.contentGated // Content Gated moderation.contentRestriction // Content Moderation moderation.notice // Moderation Notice moderation.warning.group // Group Moderation Warning moderation.report.closed // Moderation avatarReview.success // Avatar Approved avatarReview.failure // Avatar Rejected promo.redeem // Promo badge.earned // Badge Earned text.adventure // Adventure vrcplus.gift // VRC+ Gift boop // Boop ).

const (
	// NotificationTypeEconomyAlert is a NotificationType of type economy.alert.
	// Economy
	NotificationTypeEconomyAlert NotificationType = "economy.alert"
	// NotificationTypeGroupAnnouncement is a NotificationType of type group.announcement.
	// Group Announcement
	NotificationTypeGroupAnnouncement NotificationType = "group.announcement"
	// NotificationTypeGroupInformative is a NotificationType of type group.informative.
	// Group
	NotificationTypeGroupInformative NotificationType = "group.informative"
	// NotificationTypeGroupInvite is a NotificationType of type group.invite.
	// Group Invite
	NotificationTypeGroupInvite NotificationType = "group.invite"
	// NotificationTypeGroupJoinRequest is a NotificationType of type group.joinRequest.
	// Group Join Request
	NotificationTypeGroupJoinRequest NotificationType = "group.joinRequest"
	// NotificationTypeGroupPost is a NotificationType of type group.post.
	// Group Post
	NotificationTypeGroupPost NotificationType = "group.post"
	// NotificationTypeEventAnnouncement is a NotificationType of type event.announcement.
	// Event Announcement
	NotificationTypeEventAnnouncement NotificationType = "event.announcement"
	// NotificationTypeInviteInstanceContentGated is a NotificationType of type invite.instance.contentGated.
	// Content Gated
	NotificationTypeInviteInstanceContentGated NotificationType = "invite.instance.contentGated"
	// NotificationTypeModerationContentRestriction is a NotificationType of type moderation.contentRestriction.
	// Content Moderation
	NotificationTypeModerationContentRestriction NotificationType = "moderation.contentRestriction"
	// NotificationTypeModerationNotice is a NotificationType of type moderation.notice.
	// Moderation Notice
	NotificationTypeModerationNotice NotificationType = "moderation.notice"
	// NotificationTypeModerationWarningGroup is a NotificationType of type moderation.warning.group.
	// Group Moderation Warning
	NotificationTypeModerationWarningGroup NotificationType = "moderation.warning.group"
	// NotificationTypeModerationReportClosed is a NotificationType of type moderation.report.closed.
	// Moderation
	NotificationTypeModerationReportClosed NotificationType = "moderation.report.closed"
	// NotificationTypeAvatarReviewSuccess is a NotificationType of type avatarReview.success.
	// Avatar Approved
	NotificationTypeAvatarReviewSuccess NotificationType = "avatarReview.success"
	// NotificationTypeAvatarReviewFailure is a NotificationType of type avatarReview.failure.
	// Avatar Rejected
	NotificationTypeAvatarReviewFailure NotificationType = "avatarReview.failure"
	// NotificationTypePromoRedeem is a NotificationType of type promo.redeem.
	// Promo
	NotificationTypePromoRedeem NotificationType = "promo.redeem"
	// NotificationTypeBadgeEarned is a NotificationType of type badge.earned.
	// Badge Earned
	NotificationTypeBadgeEarned NotificationType = "badge.earned"
	// NotificationTypeTextAdventure is a NotificationType of type text.adventure.
	// Adventure
	NotificationTypeTextAdventure NotificationType = "text.adventure"
	// NotificationTypeVrcplusGift is a NotificationType of type vrcplus.gift.
	// VRC+ Gift
	NotificationTypeVrcplusGift NotificationType = "vrcplus.gift"
	// NotificationTypeBoop is a NotificationType of type boop.
	// Boop
	NotificationTypeBoop NotificationType = "boop"
)

func ParseNotificationType

func ParseNotificationType(name string) (NotificationType, error)

ParseNotificationType attempts to convert a string to a NotificationType.

func (*NotificationType) AppendText

func (x *NotificationType) AppendText(b []byte) ([]byte, error)

AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.

Implementations must not retain b, nor mutate any bytes within b[:len(b)].

func (NotificationType) FullName

func (n NotificationType) FullName() string

func (NotificationType) IsValid

func (x NotificationType) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (NotificationType) MarshalText

func (x NotificationType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (NotificationType) String

func (x NotificationType) String() string

String implements the Stringer interface.

func (*NotificationType) UnmarshalText

func (x *NotificationType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type Notifications

type Notifications []*Notification

type Option

type Option func(*Client)

func WithBaseURL

func WithBaseURL(url string) Option

func WithClient

func WithClient(client *http.Client) Option

func WithIdentify

func WithIdentify(appName, version, contact string) Option

WithIdentify sets application identification information. When using the VRChat API, you must specify your application name, version, and contact information to identify your application. Contact information must be either an email address or URL.

type Platform

type Platform string

Platform enum. ENUM( StandaloneWindows // Windows Android iOS ).

const (
	// PlatformStandaloneWindows is a Platform of type StandaloneWindows.
	// Windows
	PlatformStandaloneWindows Platform = "StandaloneWindows"
	// PlatformAndroid is a Platform of type Android.
	PlatformAndroid Platform = "Android"
	// PlatformIOS is a Platform of type iOS.
	PlatformIOS Platform = "iOS"
)

func ParsePlatform

func ParsePlatform(name string) (Platform, error)

ParsePlatform attempts to convert a string to a Platform.

func (*Platform) AppendText

func (x *Platform) AppendText(b []byte) ([]byte, error)

AppendText appends the textual representation of itself to the end of b (allocating a larger slice if necessary) and returns the updated slice.

Implementations must not retain b, nor mutate any bytes within b[:len(b)].

func (Platform) FullName

func (p Platform) FullName() string

func (Platform) IsValid

func (x Platform) IsValid() bool

IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values

func (Platform) MarshalText

func (x Platform) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method.

func (Platform) String

func (x Platform) String() string

String implements the Stringer interface.

func (*Platform) UnmarshalText

func (x *Platform) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method.

type User

type User struct {
	AgeVerificationStatus          string       `json:"ageVerificationStatus"`
	AgeVerified                    bool         `json:"ageVerified"`
	AllowAvatarCopying             bool         `json:"allowAvatarCopying"`
	Badges                         []*UserBadge `json:"badges"`
	Bio                            string       `json:"bio"`
	BioLinks                       []string     `json:"bioLinks"`
	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"`
	FriendKey                      string       `json:"friendKey"`
	FriendRequestStatus            string       `json:"friendRequestStatus"`
	ID                             string       `json:"id"`
	InstanceID                     string       `json:"instanceId"`
	IsFriend                       bool         `json:"isFriend"`
	LastActivity                   string       `json:"last_activity"`
	LastLogin                      string       `json:"last_login"`
	LastMobile                     string       `json:"last_mobile"`
	LastPlatform                   Platform     `json:"last_platform"`
	Location                       string       `json:"location"`
	Note                           string       `json:"note"`
	Platform                       string       `json:"platform"`
	ProfilePicOverride             string       `json:"profilePicOverride"`
	ProfilePicOverrideThumbnail    string       `json:"profilePicOverrideThumbnail"`
	Pronouns                       string       `json:"pronouns"`
	State                          string       `json:"state"`
	Status                         string       `json:"status"`
	StatusDescription              string       `json:"statusDescription"`
	Tags                           []string     `json:"tags"`
	TravelingToInstance            string       `json:"travelingToInstance"`
	TravelingToLocation            string       `json:"travelingToLocation"`
	TravelingToWorld               string       `json:"travelingToWorld"`
	UserIcon                       string       `json:"userIcon"`
	Username                       string       `json:"username"`
	WorldID                        string       `json:"worldId"`
}

type UserBadge

type UserBadge struct {
	AssignedAt       time.Time `json:"assignedAt"`
	BadgeDescription string    `json:"badgeDescription"`
	BadgeID          string    `json:"badgeId"`
	BadgeImageURL    string    `json:"badgeImageUrl"`
	BadgeName        string    `json:"badgeName"`
	Hidden           bool      `json:"hidden"`
	Showcased        bool      `json:"showcased"`
	UpdatedAt        time.Time `json:"updatedAt"`
}

type UserSearch

type UserSearch struct {
	Bio                            string   `json:"bio"`
	BioLinks                       []string `json:"bioLinks"`
	CurrentAvatarImageURL          string   `json:"currentAvatarImageUrl"`
	CurrentAvatarThumbnailImageURL string   `json:"currentAvatarThumbnailImageUrl"`
	CurrentAvatarTags              []string `json:"currentAvatarTags"`
	DeveloperType                  string   `json:"developerType"`
	DisplayName                    string   `json:"displayName"`
	ID                             string   `json:"id"`
	IsFriend                       bool     `json:"isFriend"`
	LastPlatform                   Platform `json:"last_platform"`
	ProfilePicOverride             string   `json:"profilePicOverride"`
	Pronouns                       string   `json:"pronouns"`
	Status                         string   `json:"status"`
	StatusDescription              string   `json:"statusDescription"`
	Tags                           []string `json:"tags"`
	UserIcon                       string   `json:"userIcon"`
}

type UserSearchResponse

type UserSearchResponse []*UserSearch

Jump to

Keyboard shortcuts

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