psn_go

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 10 Imported by: 0

README

psn-go

A PSN API Wrap written by Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(npsso string) (Access string, Refresh string, err error)

Types

type AuthTokensResponse added in v0.0.3

type AuthTokensResponse struct {
	AccessToken           string `json:"access_token"`
	TokenType             string `json:"token_type"`
	ExpiresIn             int    `json:"expires_in"`
	Scope                 string `json:"scope"`
	IDToken               string `json:"id_token"`
	RefreshToken          string `json:"refresh_token"`
	RefreshTokenExpiresIn int    `json:"refresh_token_expires_in"`
}

type CodeResponse added in v0.0.3

type CodeResponse struct {
	Code string `schema:"code"`
	Cid  string `schema:"cid"`
}

type GameTrophyList added in v0.0.3

type GameTrophyList struct {
	TrophySetVersion string   `json:"trophySetVersion"`
	HasTrophyGroups  bool     `json:"hasTrophyGroups"`
	TotalItemCount   int      `json:"totalItemCount"`
	Trophies         []Trophy `json:"trophies"`
}

func GetGamesTrophies

func GetGamesTrophies(accessToken string, npCommunicationIds string, ifPs5 bool) (gl GameTrophyList, err error)

GetGamesTrophies 查询游戏内所有成就详细信息

type GameTrophyStatusList added in v0.0.3

type GameTrophyStatusList struct {
	TrophySetVersion string         `json:"trophySetVersion"`
	HasTrophyGroups  bool           `json:"hasTrophyGroups"`
	TotalItemCount   int            `json:"totalItemCount"`
	Trophies         []TrophyStatus `json:"trophies"`
}

func GetPlayTrophyStatus

func GetPlayTrophyStatus(accessToken string, npCommunicationId string, ifPs5 bool) (gl GameTrophyStatusList, err error)

GetPlayTrophyStatus Find a list of game achievements by npCommunicationId contain the trophy info

type PlayerGameTrophyInfo added in v0.0.3

type PlayerGameTrophyInfo struct {
	NpServiceName       string `json:"npServiceName"`     // Service Type  PS5 Games: trophy2,  others : trophy
	NpCommunicationID   string `json:"npCommunicationId"` // kind of Game ID
	TrophySetVersion    string `json:"trophySetVersion"`
	TrophyTitleName     string `json:"trophyTitleName"`
	TrophyTitleIconURL  string `json:"trophyTitleIconUrl"`
	TrophyTitlePlatform string `json:"trophyTitlePlatform"`
	HasTrophyGroups     bool   `json:"hasTrophyGroups"`
	DefinedTrophies     struct {
		Bronze   int `json:"bronze"`
		Silver   int `json:"silver"`
		Gold     int `json:"gold"`
		Platinum int `json:"platinum"`
	} `json:"definedTrophies"`
	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"`
	LastUpdatedDateTime time.Time `json:"lastUpdatedDateTime"`
}

PlayerGameTrophyInfo struct of the latest trophies' player recently achieved

func GetTrophyGameList

func GetTrophyGameList(accessToken string) (p []PlayerGameTrophyInfo, err error)

GetTrophyGameList List of all recently played games

type PlayerTrophyList added in v0.0.3

type PlayerTrophyList struct {
	TrophyTitles []PlayerGameTrophyInfo `json:"trophyTitles"`
}

PlayerTrophyList http Response

type Top10Trophy added in v0.0.3

type Top10Trophy struct {
}

type Trophy added in v0.0.3

type Trophy 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"`
	TrophyGroupID string `json:"trophyGroupId"`
}

type TrophyStatus added in v0.0.3

type TrophyStatus struct {
	TrophyID         int    `json:"trophyId"`
	TrophyHidden     bool   `json:"trophyHidden"`
	Earned           bool   `json:"earned"`
	TrophyType       string `json:"trophyType"`
	TrophyRare       int    `json:"trophyRare"`
	TrophyEarnedRate string `json:"trophyEarnedRate"`
	EarnedDateTime   string `json:"earnedDateTime"`
}

type UserTrophies added in v0.0.3

type UserTrophies struct {
	ID                string
	UserID            string
	NpCommunicationId string
	TrophyID          string
	EarnedDateTime    string
}

type UserTrophy added in v0.0.3

type UserTrophy struct {
	ID                  int    `gorm:"primary_key" json:"id"`
	GameTitle           string `json:"game_title"`
	TrophyID            int    `json:"trophyId"`
	TrophyName          string `json:"trophyName"`
	TrophyTitlePlatform string `json:"trophy_title_platform"`
	TrophyType          string `json:"trophyType"`
	TrophyDetail        string `json:"trophyDetail"`
	TrophyIconURL       string `json:"trophyIconUrl"`
	EarnedDateTime      string `json:"earnedDateTime"`
	TrophyEarnedRate    string `json:"trophyEarnedRate"`
}

func AggregatePlayerTopTrophies

func AggregatePlayerTopTrophies(accessToken string, limit int) (m []UserTrophy, err error)

AggregatePlayerTopTrophies aggregate trophy and have earned and trophyDetail

Jump to

Keyboard shortcuts

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