Documentation ¶
Overview ¶
Package ikaring provides http client Api for SplatNet; web service for Splatoon by Nintendo.
Index ¶
- type Festival
- type FestivalScore
- type Friend
- type IkaClient
- func (c *IkaClient) Authorized() bool
- func (c *IkaClient) GetFriendList(ctx context.Context) ([]Friend, error)
- func (c *IkaClient) GetRanking(ctx context.Context) (*RankingInfo, error)
- func (c *IkaClient) GetStageInfo(ctx context.Context) (*StageInfo, error)
- func (c *IkaClient) GetWeaponMap(ctx context.Context) (map[string]string, error)
- func (c *IkaClient) Login(ctx context.Context, name string, password string) (string, error)
- func (c *IkaClient) SetSession(session string)
- type Intention
- type PlayMode
- type Player
- type PlayerScore
- type RankingInfo
- type Regulation
- type Schedule
- type Stage
- type StageInfo
- type TimeSpan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Festival ¶
type Festival struct { TimeSpan TeamA string `json:"team_alpha_name"` // Name of Team A TeamB string `json:"team_bravo_name"` // Name of Team B Stages []Stage `json:"stages"` // Stage Set }
Festival is a rule set in Festival
type FestivalScore ¶
type FestivalScore struct { PlayerScore Top100 bool }
FestivalScore has player info for festival ranking
type IkaClient ¶
type IkaClient struct { BaseURL *url.URL // Splatnet Domain URL AuthURL *url.URL // Nintendo Network OAUTH URL Logger *log.Logger // Logger // contains filtered or unexported fields }
IkaClient is a http client for SplatNet. it includes http.Client.
func CreateClient ¶
CreateClient generates ikaClient, http client object for Splatnet. It provides a http client with empty cookiejar.
func (*IkaClient) Authorized ¶
Authorized judges wheather the client authorized It checks cookies for session that used for authorization
func (*IkaClient) GetFriendList ¶
GetFriendList get Friend List form SplatNet. this API send GET request and parse friend online status from JSON
func (*IkaClient) GetRanking ¶
func (c *IkaClient) GetRanking(ctx context.Context) (*RankingInfo, error)
GetRanking get Ranking of Friends from SplatNet. this API send GET request and parse ranking from JSON.
func (*IkaClient) GetStageInfo ¶
GetStageInfo get Stage Info from SplatNet. this API send GET request and parse stage schedules from JSON.
func (*IkaClient) GetWeaponMap ¶
GetWeaponMap get Weapon Set from SplatNet. this API send GET request and parse weapon map by scraping HTML
func (*IkaClient) Login ¶
Login sends http request to authorize Nintendo Network. it require NNID and password and return session cookie.
func (*IkaClient) SetSession ¶
SetSession sets session cookie to receiver IkaClient.
type Player ¶
type Player struct { ID string `json:"hashed_id"` Name string `json:"mii_name"` MiiURL string `json:"mii_url"` Weapon string }
Player has player info.
type PlayerScore ¶
PlayerScore has player info for ranking
func (*PlayerScore) UnmarshalJSON ¶
func (p *PlayerScore) UnmarshalJSON(b []byte) error
UnmarshalJSON parse JSON for PlayerScore for SplatNet Ranking.
type RankingInfo ¶
type RankingInfo struct { Regular []PlayerScore Gachi []PlayerScore Festival []FestivalScore }
RankingInfo has ranking for Regular Match and Gachi Match
type Regulation ¶
type Regulation struct { Regular []Stage // stage set for Regular Match Gachi []Stage // stage set for Gatch Match }
Regulation is buttle regulation for Regular Match & Gachi Match. It includes stage set.
type Schedule ¶
type Schedule struct { TimeSpan Stages Regulation `json:"stages"` // Stage Set GachiRule string `json:"gachi_rule"` // rule for Gatch Match }
Schedule is a rule set for normal day. It has time span, stage set, and gachi rule.
type Stage ¶
type Stage struct { Name string `json:"name"` // stage name Image string `json:"asset_path"` // url for stage image }
Stage has stage infomation.