Documentation ¶
Index ¶
- Variables
- func SetToken(t string)
- type BadgeUrls
- type Clan
- type ClanMember
- type ClanRanking
- type ClanReference
- type ClanVersusRanking
- type ClanWar
- type ClanWarAttack
- type ClanWarLeague
- type ClanWarLeagueGroup
- type ClanWarLeagueWar
- type ClanWarMember
- type ClanWarTeam
- type CoCTime
- type IconUrls
- type Label
- type League
- type LeagueSeason
- type LeagueSeasonRanking
- type Location
- type Player
- type PlayerAchievement
- type PlayerRanking
- type PlayerVersusRanking
- type Troop
- type WarLeague
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type BadgeUrls ¶
type BadgeUrls struct { Small string `json:"small"` Large string `json:"large"` Medium string `json:"medium"` }
BadgeUrls are the URLs for badges
type Clan ¶
type Clan struct { BadgeUrls BadgeUrls `json:"badgeUrls"` ClanLevel int `json:"clanLevel"` ClanPoints int `json:"clanPoints"` ClanVersusPoints int `json:"clanVersusPoints"` Description string `json:"description"` IsWarLogPublic bool `json:"isWarLogPublic"` Labels []Label `json:"labels"` Location Location `json:"location"` Members int `json:"members"` Name string `json:"name"` RequiredTrophies int `json:"requiredTrophies"` Tag string `json:"tag"` Type string `json:"type"` WarFrequency string `json:"warFrequency"` WarLeague ClanWarLeague `json:"warLeague"` WarLosses int `json:"warLosses"` WarTies int `json:"warTies"` WarWins int `json:"warWins"` WarWinStreak int `json:"warWinStreak"` }
Clan is a clan in Clash of Clans.
type ClanMember ¶
type ClanMember struct { ClanRank int `json:"clanRank"` Donations int `json:"donations"` DonationsReceived int `json:"donationsReceived"` ExpLevel int `json:"expLevel"` League League `json:"league"` Name string `json:"name"` PreviousClanRank int `json:"previousClanRank"` Role string `json:"role"` Tag string `json:"tag"` Trophies int `json:"trophies"` VersusTrophies int `json:"versusTrophies"` }
ClanMember is a member of a given clan.
func GetClanMembers ¶
func GetClanMembers(clanTag string, qparms rest.QParms) ([]ClanMember, error)
GetClanMembers gets information about members of a given clan
func (ClanMember) String ¶
func (m ClanMember) String() string
String returns a string representation of a clan member
type ClanRanking ¶
type ClanRanking struct { BadgeUrls BadgeUrls `json:"badgeUrls"` ClanLevel int `json:"clanLevel"` ClanPoints int `json:"clanPoints"` Location Location `json:"location"` Members int `json:"members"` Name string `json:"name"` PreviousRank int `json:"previousRank"` Rank int `json:"rank"` Tag string `json:"tag"` }
ClanRanking is the clan ranking for a specific location.
func GetClanRankings ¶
func GetClanRankings(locationID string, qparms rest.QParms) ([]ClanRanking, error)
GetClan Rankings gets clan rankings for a specific location
func (ClanRanking) String ¶
func (l ClanRanking) String() string
String returns a string representation of a clan ranking
type ClanReference ¶
type ClanReference struct { BadgeUrls BadgeUrls `json:"badgeUrls"` ClanLevel int `json:"clanLevel"` Name string `json:"name"` Tag string `json:"tag"` }
ClanReference provides a reference to a given clan
func (ClanReference) String ¶
func (r ClanReference) String() string
String returns a string representation of a clan member
type ClanVersusRanking ¶
type ClanVersusRanking struct { ClanVersusPoints int `json:"clanVersusPoints"` ClanPoints int `json:"clanPoints"` }
ClanVersusRanking is the clan versus ranking for a specific location
func GetClanVersusRankings ¶
func GetClanVersusRankings(locationID string, qparms rest.QParms) ([]ClanVersusRanking, error)
GetClanRankings gets clan versus rankings for a specific location
func (ClanVersusRanking) String ¶
func (l ClanVersusRanking) String() string
String returns a string representation of a clan versus ranking
type ClanWar ¶
type ClanWar struct { State string `json:"state,omitempty"` TeamSize int `json:"teamSize"` PreparationStartTime CoCTime `json:"preparationStartTime,omitempty"` StartTime CoCTime `json:"startTime,omitempty"` EndTime CoCTime `json:"endTime,omitempty"` Result string `json:"result,omitempty"` Clan ClanWarTeam `json:"clan"` Opponent ClanWarTeam `json:"opponent"` }
ClanWar is a given war in a clan's war log.
func GetClanWars ¶
GetClanWars returns a list of wars a clan has particiapted in
func GetCurrentWar ¶
GetCurrentWar returns information about the current war a clan is participating in
type ClanWarAttack ¶
type ClanWarAttack struct { Order int `json:"order"` AttackerTag string `json:"attackerTag"` DefenderTag string `json:"defenderTag"` Stars int `json:"stars"` DestructionPercentage int `json:"destructionPercentage"` }
ClanWarAttack is an attack made in a clan war.
func (ClanWarAttack) String ¶
func (cwa ClanWarAttack) String() string
String returns a string representation of a clan war atack
type ClanWarLeague ¶
ClanWarLeague is a reference to a given clan war league
func (ClanWarLeague) String ¶
func (wl ClanWarLeague) String() string
String returns a string representation of a clan war league
type ClanWarLeagueGroup ¶
type ClanWarLeagueGroup struct { Clans []struct { BadgeUrls BadgeUrls `json:"badgeUrls"` ClanLevel int `json:"clanLevel"` Members []struct { Name string `json:"name"` Tag string `json:"tag"` TownHallLevel int `json:"townHallLevel"` } `json:"members"` Name string `json:"name"` Tag string `json:"tag"` } `json:"clans"` Rounds []struct { WarTags []string `json:"warTags"` } `json:"rounds"` Season string `json:"season"` State string `json:"state"` Tag string `json:"tag"` }
ClanWarLeagueGroup is a clan's current clan war league group.
func GetClanWarLeagueGroup ¶
func GetClanWarLeagueGroup(clanTag string) (*ClanWarLeagueGroup, error)
GetClanWarLeagueGroup retrieves information about clan's current clan war league group
func (ClanWarLeagueGroup) String ¶
func (lg ClanWarLeagueGroup) String() string
String returns a string representation of a clan war league group
type ClanWarLeagueWar ¶
type ClanWarLeagueWar struct { Clan ClanWarTeam `json:"clan"` EndTime string `json:"endTime"` Opponent ClanWarTeam `json:"opponent"` PreparationStartTime string `json:"preparationStartTime"` StartTime string `json:"startTime"` State string `json:"state"` TeamSize int `json:"teamSize"` WarStartTime string `json:"warStartTime"` }
ClanWarLeagueWar is information about an individual clan war league war
func GetClanWarLeagueWar ¶
func GetClanWarLeagueWar(clanTag string) (*ClanWarLeagueWar, error)
GetClanWarLeagueWar retrieves information about individual clan war league war
func (ClanWarLeagueWar) String ¶
func (lw ClanWarLeagueWar) String() string
String returns a string representation of a clan war league war
type ClanWarMember ¶
type ClanWarMember struct { Attacks []ClanWarAttack `json:"attacks,omitempty"` BestOpponentAttack ClanWarAttack `json:"bestOpponentAttack,omitempty"` MapPosition int `json:"mapPosition"` Name string `json:"name"` OpponentAttacks int `json:"opponentAttacks"` Tag string `json:"tag"` TownhallLevel int `json:"townhallLevel"` }
ClanWarMember is a member who participated in a clan war.
func (ClanWarMember) String ¶
func (cwm ClanWarMember) String() string
String returns a string representation of a clan war member
type ClanWarTeam ¶
type ClanWarTeam struct { Attacks int `json:"attacks"` BadgeUrls BadgeUrls `json:"badgeUrls"` ClanLevel int `json:"clanLevel"` DestructionPercentage float32 `json:"destructionPercentage"` ExpEarned int `json:"expEarned"` Members []ClanWarMember `json:"members,omitempty"` Name string `json:"name"` Stars int `json:"stars"` Tag string `json:"tag"` }
ClanWarTeam is the clan that is participating in the clan war.
func (ClanWarTeam) String ¶
func (cwt ClanWarTeam) String() string
String returns a string representation of a clan war team
type CoCTime ¶
CoCTime is a redefinition of the Time structure. This allows for unmarshalling of the time format used by Clash of Clans.
func (CoCTime) MarshalJSON ¶
MarshalJSON converts a CoCTime into a JSON string
func (*CoCTime) UnmarshalJSON ¶
UnmarshalJSON parses a JSON string into a CocTime structure
type Label ¶
type Label struct { Name string `json:"name"` ID int `json:"id"` IconUrls IconUrls `json:"iconUrls"` }
Label is a label for a clan or player.
func GetClanLabels ¶
GetClanLabels lists clan labels
func GetPlayerLabels ¶
GetPlayerLabels lists player labels
type League ¶
type League struct { IconUrls IconUrls `json:"iconUrls"` ID int `json:"id"` Name string `json:"name"` }
League lists leagues
func GetLeagues ¶
GetLeagues lists the leagues
type LeagueSeason ¶
type LeagueSeason struct {
ID string `json:"id"`
}
LeagueSeason is a league season.
func GetLeagueSeasons ¶
func GetLeagueSeasons(leagueID string) ([]LeagueSeason, error)
GetLeagueSeasons gets the league seasons
func (LeagueSeason) String ¶
func (ls LeagueSeason) String() string
String returns a string representation of a league season
type LeagueSeasonRanking ¶
type LeagueSeasonRanking struct { AttackWins int `json:"attackWins"` Clan ClanReference `json:"clan"` DefenseWins int `json:"defenseWins"` ExpLevel int `json:"expLevel"` League League `json:"league"` Name string `json:"name"` PreviousRank int `json:"previousRank"` Rank int `json:"rank"` Tag string `json:"tag"` Trophies int `json:"trophies"` }
LeagueSeasonRanking is the league season ranking.
func GetLeagueSeasonRankings ¶
func GetLeagueSeasonRankings(leagueID string) ([]LeagueSeasonRanking, error)
GetLeagueSeasonRankings gets the league season rankings for Legend League
func (LeagueSeasonRanking) String ¶
func (lsr LeagueSeasonRanking) String() string
String returns a string representation of a league season
type Location ¶
type Location struct { CountryCode string `json:"countryCode"` ID int `json:"id"` IsCountry bool `json:"isCountry"` LocalizedName string `json:"localizedName"` Name string `json:"name"` }
Location is information about a location
func GetLocation ¶
GetLocation gets the location information
func GetLocations ¶
GetLocations lists locations
type Player ¶
type Player struct { Achievements []PlayerAchievement `json:"achievements"` AttackWins int `json:"attackWins"` BestTrophies int `json:"bestTrophies"` BestVersusTrophies int `json:"bestVersusTrophies"` BuilderHallLevel int `json:"builderHallLevel"` Clan ClanReference `json:"clan"` DefenseWins int `json:"defenseWins"` Donations int `json:"donations"` DonationsReceived int `json:"donationsReceived"` ExpLevel int `json:"expLevel"` Heroes []Troop `json:"heroes"` Labels []Label `json:"labels"` League League `json:"league"` Name string `json:"name"` Role string `json:"role"` Spells []Troop `json:"spells"` Tag string `json:"tag"` TownHallLevel int `json:"townHallLevel"` Troops []Troop `json:"troops"` Trophies int `json:"trophies"` VersusBattleWinCount int `json:"versusBattleWinCount"` VersusBattleWins int `json:"versusBattleWins"` VersusTrophies int `json:"versusTrophies"` WarStars int `json:"warStars"` }
Player is a single player in Clash of Clans.
type PlayerAchievement ¶
type PlayerAchievement struct { CompletionInfo string `json:"completionInfo"` Info string `json:"info"` Name string `json:"name"` Stars int `json:"stars"` Target int `json:"target"` Value int `json:"value"` Village string `json:"village"` }
func (PlayerAchievement) String ¶
func (a PlayerAchievement) String() string
String returns a string representation of a player achievement
type PlayerRanking ¶
type PlayerRanking struct { Clan ClanReference `json:"clan"` League League `json:"league"` AttackWins int `json:"attackWins"` DefenseWins int `json:"defenseWins"` Tag string `json:"tag"` Name string `json:"name"` ExpLevel int `json:"expLevel"` Rank int `json:"rank"` PreviousRank int `json:"previousRank"` Trophies int `json:"trophies"` }
PlayerRanking is the ranking of a player for specific location.
func GetPlayerRankings ¶
func GetPlayerRankings(locationID string, qparms rest.QParms) ([]PlayerRanking, error)
GetPlayerRankings gets player rankings for a specific location
func (PlayerRanking) String ¶
func (l PlayerRanking) String() string
String returns a string representation of a location player ranking
type PlayerVersusRanking ¶
type PlayerVersusRanking struct { Clan ClanReference `json:"clan"` VersusBattleWins int `json:"versusBattleWins"` Tag string `json:"tag"` Name string `json:"name"` ExpLevel int `json:"expLevel"` Rank int `json:"rank"` PreviousRank int `json:"previousRank"` VersusTrophies int `json:"versusTrophies"` }
PlayerVersusRanking is the player ranking for a specific location
func GetPlayerVersusRankings ¶
func GetPlayerVersusRankings(locationID string, qparms rest.QParms) ([]PlayerVersusRanking, error)
GetPlayerRankings gets clan versus rankings for a specific location
func (PlayerVersusRanking) String ¶
func (l PlayerVersusRanking) String() string
String returns a string representation of a player-versus ranking for a location
type Troop ¶
type Troop struct { Level int `json:"level"` MaxLevel int `json:"maxLevel"` Name string `json:"name"` Village string `json:"village"` }
Troop represents a troop, hero or spell in Clash of Clans
type WarLeague ¶
WarLeague is information about a war league.
func GetWarLeague ¶
GetLWareague gets the war league information
func GetWarLeagues ¶
GetWarLeagues lists the war leagues