Documentation
¶
Index ¶
- Variables
- type Api
- func (api *Api) GetProfileRequest(ctx context.Context, username string) (profile *Profile, err error)
- func (api *Api) GetTrophies(ctx context.Context, titleId, trophyGroupId, username string) ([]Trophy, error)
- func (api *Api) GetTrophyGroups(ctx context.Context, trophyTitleId, username string) (TrophyTitle, error)
- func (api *Api) GetTrophyTitles(ctx context.Context, username string, limit, offset int) ([]TrophyTitleFull, error)
- func (api *Api) RefreashAccessToken(ctx context.Context) error
- type Authenticator
- type AvatarUrls
- type ConsoleAvailability
- type Language
- type Options
- type PersonalDetail
- type Presences
- type Profile
- type Region
- type Trophy
- type TrophyCount
- type TrophyGroup
- type TrophySummary
- type TrophyTitle
- type TrophyTitleFull
- type User
- type UserEarned
- type UserProgress
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNPSSOEmpty = errors.New("npsso is empty") ErrNPSSOLength = errors.New("npsso must be exactly 64 characters") )
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct { *Authenticator // contains filtered or unexported fields }
func (*Api) GetProfileRequest ¶
func (api *Api) GetProfileRequest(ctx context.Context, username string) (profile *Profile, err error)
Method retrieves user profile info by PSN id
func (*Api) GetTrophies ¶
func (api *Api) GetTrophies(ctx context.Context, titleId, trophyGroupId, username string) ([]Trophy, error)
Method retrieves user's trophies
func (*Api) GetTrophyGroups ¶
func (api *Api) GetTrophyGroups(ctx context.Context, trophyTitleId, username string) (TrophyTitle, error)
Method retrieves user's trophy groups
func (*Api) GetTrophyTitles ¶
func (api *Api) GetTrophyTitles(ctx context.Context, username string, limit, offset int) ([]TrophyTitleFull, error)
GetTrophyTitles retrieves a user's trophy titles
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func NewApi ¶
func NewApi(opts ...Options) *Authenticator
New API creates a new API caller Default langage and region are the first in SupportedLanguages and SupportedRegions resp.
func (*Authenticator) Authenticate ¶
type AvatarUrls ¶
type ConsoleAvailability ¶
type ConsoleAvailability struct {
AvailabilityStatus string `json:"availabilityStatus"`
}
type Language ¶
type Language string
TODO: candidate for code generation
var ( LangJA Language = "ja" LangEN Language = "en" LangENGB Language = "en-GB" LangENUS Language = "en-US" LangFR Language = "fr" LangES Language = "es" LangESMX Language = "es-MX" LangDE Language = "de" LangIT Language = "it" LangNL Language = "nl" LangPT Language = "pt" LangPTBR Language = "pt-BR" LangRU Language = "ru" LangPL Language = "pl" LangFI Language = "fi" LangDA Language = "da" LangNO Language = "no" LangSV Language = "sv" LangTR Language = "tr" LangKO Language = "ko" LangZHCN Language = "zh-CN" LangZHTW Language = "zh-TW" )
func SupportedLanguages ¶
func SupportedLanguages() []Language
type PersonalDetail ¶
type Profile ¶
type Profile struct { User NpID string `json:"npId"` AvatarUrls []AvatarUrls `json:"avatarUrls"` Plus int `json:"plus"` AboutMe string `json:"aboutMe"` LanguagesUsed []string `json:"languagesUsed"` TrophySummary TrophySummary `json:"trophySummary"` IsOfficiallyVerified bool `json:"isOfficiallyVerified"` PersonalDetail PersonalDetail `json:"personalDetail"` PersonalDetailSharing string `json:"personalDetailSharing"` PrimaryOnlineStatus string `json:"primaryOnlineStatus"` Presences []Presences `json:"presences"` FriendRelation string `json:"friendRelation"` Blocking bool `json:"blocking"` MutualFriendsCount int `json:"mutualFriendsCount"` Following bool `json:"following"` FollowerCount int `json:"followerCount"` ConsoleAvailability ConsoleAvailability `json:"consoleAvailability"` }
type Region ¶
type Region string
TODO: candidate for code generation
var ( RegionUS Region = "us" RegionCA Region = "ca" RegionMX Region = "mx" RegionCL Region = "cl" RegionPE Region = "pe" RegionAR Region = "ar" RegionCO Region = "co" RegionBR Region = "br" RegionGB Region = "gb" RegionIE Region = "ie" RegionBE Region = "be" RegionLU Region = "lu" RegionNL Region = "nl" RegionFR Region = "fr" RegionDE Region = "de" RegionAT Region = "at" RegionCH Region = "ch" RegionIT Region = "it" RegionPT Region = "pt" RegionDK Region = "dk" RegionFI Region = "fi" RegionNO Region = "no" RegionSE Region = "se" RegionAU Region = "au" RegionNZ Region = "nz" RegionES Region = "es" RegionRU Region = "ru" RegionAE Region = "ae" RegionZA Region = "za" RegionPL Region = "pl" RegionGR Region = "gr" RegionSA Region = "sa" RegionCZ Region = "cz" RegionBG Region = "bg" RegionHR Region = "hr" RegionRO Region = "ro" RegionSI Region = "si" RegionHU Region = "hu" RegionSK Region = "sk" RegionTR Region = "tr" RegionBH Region = "bh" RegionKW Region = "kw" RegionLB Region = "lb" RegionOM Region = "om" RegionQA Region = "qa" RegionIL Region = "il" RegionMT Region = "mt" RegionIS Region = "is" RegionCY Region = "cy" RegionIN Region = "in" RegionUA Region = "ua" RegionHK Region = "hk" RegionTW Region = "tw" RegionSG Region = "sg" RegionMY Region = "my" RegionID Region = "id" RegionTH Region = "th" RegionJP Region = "jp" RegionKR Region = "kr" RegionENUS Region = "en-US" )
func SupportedRegions ¶
func SupportedRegions() []Region
type Trophy ¶
type Trophy struct { ID int `json:"trophyId"` Hidden bool `json:"trophyHidden"` Type string `json:"trophyType"` Name string `json:"trophyName"` Detail string `json:"trophyDetail"` IconURL string `json:"trophyIconUrl"` SmallIconURL string `json:"trophySmallIconUrl"` Rare int `json:"trophyRare"` EarnedRate string `json:"trophyEarnedRate"` FromUser UserEarned `json:"fromUser"` }
type TrophyCount ¶
type TrophyGroup ¶
type TrophyGroup struct { ID string `json:"trophyGroupId"` Name string `json:"trophyGroupName"` Detail string `json:"trophyGroupDetail"` IconURL string `json:"trophyGroupIconUrl"` SmallIconURL string `json:"trophyGroupSmallIconUrl"` DefinedTrophies TrophyCount `json:"definedTrophies"` ComparedUser UserProgress `json:"comparedUser"` }
type TrophySummary ¶
type TrophySummary struct { Level int `json:"level"` Progress int `json:"progress"` EarnedTrophies TrophyCount `json:"earnedTrophies"` }
type TrophyTitle ¶
type TrophyTitle struct { Name string `json:"trophyTitleName"` Detail string `json:"trophyTitleDetail"` IconURL string `json:"trophyTitleIconUrl"` Platfrom string `json:"trophyTitlePlatfrom"` // typo in Sony's response DefinedTrophies TrophyCount `json:"definedTrophies"` TrophyGroups []TrophyGroup `json:"trophyGroups"` }
type TrophyTitleFull ¶
type TrophyTitleFull struct { TrophyTitle NpCommunicationID string `json:"npCommunicationId"` TrophyTitleSmallIconURL string `json:"trophyTitleSmallIconUrl"` HasTrophyGroups bool `json:"hasTrophyGroups"` ComparedUser UserProgress `json:"comparedUser"` FromUser UserProgress `json:"fromUser"` }
type UserEarned ¶
type UserProgress ¶
Click to show internal directories.
Click to hide internal directories.