Documentation
¶
Index ¶
- type AvatarUrls
- type ConsoleAvailability
- type EarnedTrophies
- type PersonalDetail
- type Presences
- type Profile
- type ProfileResponse
- type Psn
- func (p *Psn) AuthWithNPSSO(ctx context.Context, npsso string) error
- func (p *Psn) AuthWithRefreshToken(ctx context.Context, refreshToken string) error
- func (p *Psn) GetAccessToken() (string, int32)
- func (p *Psn) GetLang() string
- func (p *Psn) GetNPSSO() string
- func (p *Psn) GetProfileRequest(ctx context.Context, name string) (profile *Profile, err error)
- func (p *Psn) GetRefreshToken() (string, int32)
- func (p *Psn) GetRegion() string
- func (p *Psn) GetTrophies(ctx context.Context, trophyTitleId, trophyGroupId, username string) (*TrophiesResponse, error)
- func (p *Psn) GetTrophyGroups(ctx context.Context, trophyTitleId, username string) (*TrophyGroupResponse, error)
- func (p *Psn) GetTrophyTitles(ctx context.Context, username string, limit, offset int32) (*TrophyTitleResponse, error)
- func (p *Psn) SetAccessToken(accessToken string) error
- func (p *Psn) SetLang(lang string) error
- func (p *Psn) SetNPSSO(npsso string) error
- func (p *Psn) SetRefreshToken(refreshToken string) error
- func (p *Psn) SetRegion(region string) error
- type TrophiesResponse
- type TrophyGroupResponse
- type TrophySummary
- type TrophyTitleResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvatarUrls ¶
type ConsoleAvailability ¶
type ConsoleAvailability struct {
AvailabilityStatus string `json:"availabilityStatus"`
}
type EarnedTrophies ¶
type PersonalDetail ¶
type Profile ¶
type Profile struct {
OnlineID string `json:"onlineId"`
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 ProfileResponse ¶
type ProfileResponse struct {
Profile Profile `json:"profile"`
}
type Psn ¶ added in v1.0.4
type Psn struct {
// contains filtered or unexported fields
}
func (*Psn) AuthWithNPSSO ¶ added in v1.0.4
Method makes auth request to Sony's server and retrieves tokens
func (*Psn) AuthWithRefreshToken ¶ added in v1.0.4
Method makes auth request to Sony's server and retrieves tokens
func (*Psn) GetAccessToken ¶ added in v1.0.4
Getter for access token
func (*Psn) GetProfileRequest ¶ added in v1.0.4
Method retrieves user profile info by PSN id
func (*Psn) GetRefreshToken ¶ added in v1.0.4
Getter for refresh token
func (*Psn) GetTrophies ¶ added in v1.0.4
func (p *Psn) GetTrophies(ctx context.Context, trophyTitleId, trophyGroupId, username string) (*TrophiesResponse, error)
Method retrieves user's trophies
func (*Psn) GetTrophyGroups ¶ added in v1.0.4
func (p *Psn) GetTrophyGroups(ctx context.Context, trophyTitleId, username string) (*TrophyGroupResponse, error)
Method retrieves user's trophy groups
func (*Psn) GetTrophyTitles ¶ added in v1.0.4
func (p *Psn) GetTrophyTitles(ctx context.Context, username string, limit, offset int32) (*TrophyTitleResponse, error)
Method retrieves user's trophy titles
func (*Psn) SetAccessToken ¶ added in v1.0.4
Setter for access token
func (*Psn) SetRefreshToken ¶ added in v1.0.4
Getter for refresh token
type TrophiesResponse ¶
type TrophiesResponse struct {
Trophies []struct {
TrophyID int `json:"trophyId"`
TrophyHidden bool `json:"trophyHidden"`
TrophyType string `json:"trophyType"`
TrophyName string `json:"trophyName"`
TrophyDetail string `json:"trophyDetail"`
TrophyIconURL string `json:"trophyIconUrl"`
TrophySmallIconURL string `json:"trophySmallIconUrl"`
TrophyRare int `json:"trophyRare"`
TrophyEarnedRate string `json:"trophyEarnedRate"`
FromUser struct {
OnlineID string `json:"onlineId"`
Earned bool `json:"earned"`
} `json:"fromUser,omitempty"`
} `json:"trophies"`
}
type TrophyGroupResponse ¶
type TrophyGroupResponse struct {
TrophyTitleName string `json:"trophyTitleName"`
TrophyTitleDetail string `json:"trophyTitleDetail"`
TrophyTitleIconURL string `json:"trophyTitleIconUrl"`
TrophyTitlePlatfrom string `json:"trophyTitlePlatfrom"`
DefinedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"definedTrophies"`
TrophyGroups []struct {
TrophyGroupID string `json:"trophyGroupId"`
TrophyGroupName string `json:"trophyGroupName"`
TrophyGroupDetail string `json:"trophyGroupDetail"`
TrophyGroupIconURL string `json:"trophyGroupIconUrl"`
TrophyGroupSmallIconURL string `json:"trophyGroupSmallIconUrl"`
DefinedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"definedTrophies"`
ComparedUser struct {
OnlineID string `json:"onlineId"`
Progress int `json:"progress"`
EarnedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"earnedTrophies"`
LastUpdateDate time.Time `json:"lastUpdateDate"`
} `json:"comparedUser"`
} `json:"trophyGroups"`
}
type TrophySummary ¶
type TrophySummary struct {
Level int `json:"level"`
Progress int `json:"progress"`
EarnedTrophies EarnedTrophies `json:"earnedTrophies"`
}
type TrophyTitleResponse ¶
type TrophyTitleResponse struct {
TotalResults int `json:"totalResults"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TrophyTitles []struct {
NpCommunicationID string `json:"npCommunicationId"`
TrophyTitleName string `json:"trophyTitleName"`
TrophyTitleDetail string `json:"trophyTitleDetail"`
TrophyTitleIconURL string `json:"trophyTitleIconUrl"`
TrophyTitleSmallIconURL string `json:"trophyTitleSmallIconUrl"`
TrophyTitlePlatfrom string `json:"trophyTitlePlatfrom"` // typo in Sony's response
HasTrophyGroups bool `json:"hasTrophyGroups"`
DefinedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"definedTrophies"`
ComparedUser struct {
OnlineID string `json:"onlineId"`
Progress int `json:"progress"`
EarnedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"earnedTrophies"`
LastUpdateDate time.Time `json:"lastUpdateDate"`
} `json:"comparedUser"`
FromUser struct {
OnlineID string `json:"onlineId"`
Progress int `json:"progress"`
EarnedTrophies struct {
Bronze int `json:"bronze"`
Silver int `json:"silver"`
Gold int `json:"gold"`
Platinum int `json:"platinum"`
} `json:"earnedTrophies"`
HiddenFlag bool `json:"hiddenFlag"`
LastUpdateDate time.Time `json:"lastUpdateDate"`
} `json:"fromUser,omitempty"`
} `json:"trophyTitles"`
}
Click to show internal directories.
Click to hide internal directories.
