Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ability ¶
type Ability struct { BaseID string `json:"base_id"` Name string `json:"name"` Image string `json:"image"` URL string `json:"url"` TierMax int `json:"tier_max"` IsZeta bool `json:"is_zeta"` IsOmega bool `json:"is_omega"` Type int `json:"type"` CombatType int `json:"combat_type"` CharacterBaseID string `json:"character_base_id"` }
Ability contains information about each character or ship abilities in the game.
type Character ¶
type Character struct { Name string `json:"name"` Description string `json:"description"` BaseID string `json:"base_id"` PK int `json:"pk"` URL string `json:"url"` Image string `json:"image"` Power int `json:"power"` CombatType int `json:"combat_type"` Alignment string `json:"alignment"` Categories []string `json:"categories"` Role string `json:"role"` AbilityClasses []string `json:"ability_classes"` GearLevels []GearLevel `json:"gear_levels"` }
Character represents a character unit in the game.
type Characters ¶
type Characters []Character
Characters is a character slice with helper methods
func (Characters) FromBaseID ¶
func (l Characters) FromBaseID(baseID string) *Character
FromBaseID search for a character using it's Base ID as criteria. Returns nil if the BaseID is not found.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the API methods described by https://swgoh.gg/api/.
This client wraps the default http.Client and exposes the API methods to make them easy to use, with some extra goodies. Data types returned can be easily manipulated and are designed to make coding with the API quick and easy tasks.
func NewClient ¶
NewClient initializes a new API client. This is required in order to prepare the internal client state, including the http.Client, context, logging and debuging.
func (*Client) Characters ¶
func (c *Client) Characters() (chars Characters, err error)
Characters returns a list of all game characters. Use this method to retrieve a list of characters and to use the resulting list in lookups and the like.
type EquipedGear ¶
type EquipedGear struct { Slot int `json:"slot"` IsObtained bool `json:"is_obtained"` BaseID string `json:"base_id"` }
EquipedGear represents unit equped gear details.
type Player ¶
type Player struct { PlayerProfile `json:"data"` Units []Unit `json:"units"` }
Player represents the player profile data from the website and game.
type PlayerProfile ¶
type PlayerProfile struct { Name string `json:"name"` Level int `json:"level"` ArenaRank int `json:"arena_rank"` ArenaLeaderBaseID string `json:"arena_leader_base_id"` AllyCode int `json:"ally_code"` GP int `json:"galactic_power"` ShipGP int `json:"ship_galactic_power"` CharacterGP int `json:"character_galactic_power"` }
PlayerProfile details the player profile information.
type StatName ¶
type StatName string
StatName is a helper Enum to recover data from UnitStats
const ( Strength StatName = "2" Agility StatName = "3" Tatics StatName = "4" Health StatName = "1" Protection StatName = "28" Speed StatName = "5" CriticalDamage StatName = "16" Potency StatName = "17" Tenaticy StatName = "18" HealthSteal StatName = "27" PhysicalDamage StatName = "6" PhysicalCriticalChange StatName = "14" ArmorPenetration StatName = "10" PhysicalAccuracy StatName = "37" Armor StatName = "8" DodgeChance StatName = "12" PhysicalCriticalAvoidance StatName = "39" SpecialDamage StatName = "7" SpecialCriticalChance StatName = "15" ResistancePenetration StatName = "11" SpecialAccuracy StatName = "38" Resistance StatName = "9" DeflectionChance StatName = "13" SpecialCriticalAvoidance StatName = "40" )
Enumerated list of stats
type UnitData ¶
type UnitData struct { BaseID string `json:"base_id"` Power int `json:"power"` Level int `json:"level"` GearLevel int `json:"gear_level"` Rarity int `json:"rarity"` URL string `json:"url"` ZetaAbilities []string `json:"zeta_abilities"` Stats UnitStats `json:"stats"` Gear []EquipedGear }
UnitData holds character data for each player unit.