Documentation
¶
Index ¶
- Variables
- type AccountIdentifier
- type BaseStat
- type BattleZone
- type Client
- func (c *Client) AccessKey() string
- func (c *Client) GetAccountIdentifier(userName string) (*AccountIdentifier, error)
- func (c *Client) GetDescendantsMetadata(language LanguageCode) ([]Descendant, error)
- func (c *Client) GetExternalComponent(ouid string, language LanguageCode) (*UserExternalComponent, error)
- func (c *Client) GetExternalComponentsMetadata(language LanguageCode) ([]ExternalComponent, error)
- func (c *Client) GetModulesMetadata(language LanguageCode) ([]Module, error)
- func (c *Client) GetReactorsMetadata(language LanguageCode) ([]Reactor, error)
- func (c *Client) GetRewardsMetadata(language LanguageCode) ([]Reward, error)
- func (c *Client) GetStatsMetadata(language LanguageCode) ([]StatMeta, error)
- func (c *Client) GetTitlesMetadata(language LanguageCode) ([]TitleResponse, error)
- func (c *Client) GetUserDescendant(ouid string) (*UserDescendant, error)
- func (c *Client) GetUserInfo(ouid string) (*UserBasic, error)
- func (c *Client) GetUserReactor(ouid string, language LanguageCode) (*UserReactor, error)
- func (c *Client) GetUserWeapons(ouid string, language LanguageCode) (*UserWeapon, error)
- func (c *Client) GetVoidBattlesMetadata(language LanguageCode) ([]VoidBattleResponse, error)
- func (c *Client) GetWeaponsMetadata(language LanguageCode) ([]Weapon, error)
- func (c *Client) SetAccessKey(key string)
- func (c *Client) SetHTTPClient(client *http.Client)
- type Descendant
- type DescendantStats
- type EnchantmentEffect
- type Error
- type ErrorMessage
- type ExternalComponent
- type ExternalComponentAdditionalStats
- type ExternalComponentInfo
- type FireArm
- type FireArmATK
- type LanguageCode
- type Module
- type ModuleInfo
- type ModuleStat
- type Reactor
- type ReactorAdditionalStats
- type Reward
- type RewardInfo
- type SetOptionDetail
- type Skill
- type SkillPower
- type SkillPowerBoost
- type StatDetail
- type StatMeta
- type TitleResponse
- type UserBasic
- type UserDescendant
- type UserExternalComponent
- type UserReactor
- type UserWeapon
- type VoidBattleResponse
- type Weapon
- type WeaponAdditionalStats
- type WeaponInfo
Constants ¶
This section is empty.
Variables ¶
var LanguageCodes = struct { Korean LanguageCode English LanguageCode Danish LanguageCode French LanguageCode Japanese LanguageCode ChineseSimplified LanguageCode ChineseTraditional LanguageCode Italian LanguageCode Polish LanguageCode Portuguese LanguageCode Russian LanguageCode Spanish LanguageCode }{ "ko", "en", "de", "fr", "ja", "zh-CN", "zh-TW", "it", "pl", "pt", "ru", "es", }
Functions ¶
This section is empty.
Types ¶
type AccountIdentifier ¶ added in v2.1.0
type AccountIdentifier struct {
OUID string `json:"ouid"` // OUID
}
type BattleZone ¶ added in v2.1.0
type BattleZone struct { ID string `json:"battle_zone_id"` Name string `json:"battle_zone_name"` Rewards []RewardInfo `json:"reward"` }
BattleZone represents information about a battlefield
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a client for The First Descendant's API.
func NewClient ¶
func NewClient() *Client
NewClient create and returns a new instance of the TFD Client
func (*Client) AccessKey ¶
AccessKey returns the current API key used by the Client. This key is required for making authenticated requests to the Nexus OpenAPI.
func (*Client) GetAccountIdentifier ¶
func (c *Client) GetAccountIdentifier(userName string) (*AccountIdentifier, error)
GetAccountIdentifier retrieves the account identifier (OUID) for a given username.
func (*Client) GetDescendantsMetadata ¶
func (c *Client) GetDescendantsMetadata(language LanguageCode) ([]Descendant, error)
GetDescendantsMetadata retrieves metadata for descendants in the specified language. It returns a slice of Descendant models and an error if the request fails.
func (*Client) GetExternalComponent ¶
func (c *Client) GetExternalComponent(ouid string, language LanguageCode) (*UserExternalComponent, error)
GetExternalComponent retrieves external component information for the user identified by the given OUID and language.
func (*Client) GetExternalComponentsMetadata ¶
func (c *Client) GetExternalComponentsMetadata(language LanguageCode) ([]ExternalComponent, error)
GetExternalComponentsMetadata retrieves metadata for external components in the specified language. It returns a slice of Weapon models and an error if the request fails.
func (*Client) GetModulesMetadata ¶
func (c *Client) GetModulesMetadata(language LanguageCode) ([]Module, error)
GetModulesMetadata retrieves metadata for modules in the specified language. It returns a slice of Module models and an error if the request fails.
func (*Client) GetReactorsMetadata ¶
func (c *Client) GetReactorsMetadata(language LanguageCode) ([]Reactor, error)
GetReactorsMetadata retrieves metadata for reactors in the specified language. It returns a slice of Reactor models and an error if the request fails.
func (*Client) GetRewardsMetadata ¶
func (c *Client) GetRewardsMetadata(language LanguageCode) ([]Reward, error)
GetRewardsMetadata retrieves metadata for rewards in the specified language. It returns a slice of Reward models and an error if the request fails.
func (*Client) GetStatsMetadata ¶
func (c *Client) GetStatsMetadata(language LanguageCode) ([]StatMeta, error)
GetStatsMetadata retrieves metadata for stats in the specified language. It returns a slice of StatMeta models and an error if the request fails.
func (*Client) GetTitlesMetadata ¶
func (c *Client) GetTitlesMetadata(language LanguageCode) ([]TitleResponse, error)
GetTitlesMetadata retrieves metadata for titles in the specified language. It returns a slice of TitleResponse models and an error if the request fails.
func (*Client) GetUserDescendant ¶
func (c *Client) GetUserDescendant(ouid string) (*UserDescendant, error)
GetUserDescendant retrieves descendant information for the user identified by the given OUID.
func (*Client) GetUserInfo ¶ added in v2.1.0
GetBasicInformation retrieves basic information about the user identified by the given OUID.
func (*Client) GetUserReactor ¶
func (c *Client) GetUserReactor(ouid string, language LanguageCode) (*UserReactor, error)
GetUserReactor retrieves reactor information for the user identified by the given OUID and language.
func (*Client) GetUserWeapons ¶
func (c *Client) GetUserWeapons(ouid string, language LanguageCode) (*UserWeapon, error)
GetUserWeapons retrieves weapon information for the user identified by the given OUID and language.
func (*Client) GetVoidBattlesMetadata ¶
func (c *Client) GetVoidBattlesMetadata(language LanguageCode) ([]VoidBattleResponse, error)
GetVoidBattlesMetadata retrieves metadata for void battles in the specified language. It returns a slice of VoidBattleResponse models and an error if the request fails.
func (*Client) GetWeaponsMetadata ¶
func (c *Client) GetWeaponsMetadata(language LanguageCode) ([]Weapon, error)
GetWeaponsMetadata retrieves metadata for weapons in the specified language. It returns a slice of Weapon models and an error if the request fails.
func (*Client) SetAccessKey ¶
SetAccessKey sets the API key for the Client. This key is used for authenticating requests to the Nexus OpenAPI.
func (*Client) SetHTTPClient ¶
SetHTTPClient allows setting a custom http.Client for the Client. This is useful for customizing request behavior, such as setting timeouts or using a different transport.
type Descendant ¶ added in v2.1.0
type Descendant struct { ID string `json:"descendant_id"` // Descendant identifier Name string `json:"descendant_name"` // Descendant name ImageURL string `json:"descendant_image_url"` // Descendant image path Stats []DescendantStats `json:"descendant_stat"` // Descendant stat information Skills []Skill `json:"descendant_skill"` // Descendant skill }
type DescendantStats ¶ added in v2.1.0
type DescendantStats struct { Level int64 `json:"level"` Details []StatDetail `json:"stat_detail"` }
type EnchantmentEffect ¶ added in v2.1.0
type EnchantmentEffect struct { Level int64 `json:"enchant_level"` StatType string `json:"stat_type"` Value float64 `json:"value"` }
Enchantment represents enchantment effect by level information
type ErrorMessage ¶
type ErrorMessage struct {
Details Error `json:"error"`
}
ErrorMessage represents the structure of the error message returned by the server. The JSON response from the server is expected to contain an "error" object with "name" and "message" fields. This structure corresponds to the JSON response format when an HTTP request fails.
func (*ErrorMessage) Error ¶
func (e *ErrorMessage) Error() string
Error implements the error interface for ErrorMessage. It marshals the error details into a JSON string and returns it. This method allows the error to be displayed as a JSON string, providing details about the error encountered.
type ExternalComponent ¶ added in v2.1.0
type ExternalComponent struct { ID string `json:"external_component_id"` // External component identifier Name string `json:"external_component_name"` // External component name ImageURL string `json:"image_url"` // External component image path EquipmentType string `json:"external_component_equipment_type"` // External component equipment part Tier string `json:"external_component_tier"` // External component tier BaseStat []struct { BaseStat Level int64 `json:"level"` // External component level } `json:"base_stat"` // External component effect by level information SetOptionDetail []SetOptionDetail `json:"set_option_detail"` // External component set option information }
ExternalComponent represents the information of an external component
type ExternalComponentAdditionalStats ¶ added in v2.1.0
type ExternalComponentInfo ¶ added in v2.1.0
type ExternalComponentInfo struct { SlotID string `json:"external_component_slot_id"` // External component slot identifier ID string `json:"external_component_id"` // External component identifier (Refer to /meta/external-component API) Level int64 `json:"external_component_level"` // External component level AdditionalStats []ExternalComponentAdditionalStats `json:"external_component_additional_stat"` // External component random option information }
type FireArmATK ¶ added in v2.1.0
type LanguageCode ¶
type LanguageCode string
type Module ¶ added in v2.1.0
type Module struct { Name string `json:"module_name"` ID string `json:"module_id"` ImageURL string `json:"image_url"` Type string `json:"module_type"` Tier string `json:"module_tier"` SocketType string `json:"module_socket_type"` Class string `json:"module_class"` Stat []ModuleStat `json:"module_stat"` }
type ModuleInfo ¶ added in v2.1.0
type ModuleStat ¶ added in v2.1.0
type Reactor ¶ added in v2.1.0
type Reactor struct { ID string `json:"reactor_id"` Name string `json:"reactor_name"` ImageURL string `json:"image_url"` Tier string `json:"reactor_tier"` SkillPower []SkillPower `json:"reactor_skill_power"` OptimizedConditionType string `json:"optimized_condition_type"` }
Reactor represents information about a reactor
type ReactorAdditionalStats ¶ added in v2.1.0
type Reward ¶ added in v2.1.0
type Reward struct { MapID string `json:"map_id"` MapName string `json:"map_name"` BattleZones []BattleZone `json:"battle_zone"` }
Reward represents information about a reward
type RewardInfo ¶ added in v2.1.0
type RewardInfo struct { Rotation int64 `json:"rotation"` Type string `json:"reward_type"` // Reward Type ReactorElementType string `json:"reactor_element_type"` WeaponRoundsType string `json:"weapon_rounds_type"` ArcheType string `json:"arche_type"` }
RewardInfo represents reward rotation information
type SetOptionDetail ¶ added in v2.1.0
type SetOptionDetail struct { Option string `json:"set_option"` // External component set option type Count int64 `json:"set_count"` // Number of external component sets OptionEffect string `json:"set_option_effect"` // External component set option set effect }
SetOptionDetail represents the set option information for an external component
type Skill ¶ added in v2.1.0
type Skill struct { Type string `json:"skill_type"` // active / passive (respective LanguageCode) Name string `json:"skill_name"` Element string `json:"element_type"` ArcheType string `json:"arche_type"` SkillImageUrl string `json:"skill_image_url"` SkillDescription string `json:"skill_description"` }
type SkillPower ¶ added in v2.1.0
type SkillPower struct { Level int64 `json:"level"` AtkPower float64 `json:"skill_atk_power"` SubSkillAtkPower float64 `json:"sub_skill_atk_power"` PowerCoefficient []SkillPowerBoost `json:"skill_power_coefficient"` EnchantEffect []EnchantmentEffect `json:"enchant_effect"` }
SkillPower represents skill power by level information
type SkillPowerBoost ¶ added in v2.1.0
type SkillPowerBoost struct { CoefficientStatID string `json:"coefficient_stat_id"` CoefficientStatValue float64 `json:"coefficient_stat_value"` }
SkillPowerBoost represents skill power boost ratio information
type StatDetail ¶ added in v2.1.0
type TitleResponse ¶ added in v2.1.0
type UserBasic ¶ added in v2.1.0
type UserBasic struct { AccountIdentifier UserName string `json:"user_name"` // Nickname PlatformType string `json:"platform_type"` // Platform type MasteryRankLevel int64 `json:"mastery_rank_level"` // Mastery Rank MasteryRankExp int64 `json:"mastery_rank_exp"` // Mastery EXP TitlePrefix string `json:"title_prefix_id"` // Prefix title identifier (Refer to /meta/title API) TitleSuffix string `json:"title_suffix_id"` // Suffix title identifier (Refer to /meta/title API) OSLanguage string `json:"os_language"` // OS language settings GameLanguage string `json:"game_language"` // Game language settings }
type UserDescendant ¶ added in v2.1.0
type UserDescendant struct { AccountIdentifier UserName string `json:"user_name"` // Nickname ID string `json:"descendant_id"` // Equipped descendant identifier SlotID string `json:"descendant_slot_id"` // Descendant slot identifier Level int64 `json:"descendant_level"` // Equipped descendant level ModuleMaxCapacity int64 `json:"module_max_capacity"` // Max. equippable module capacity ModuleCapacity int64 `json:"module_capacity"` // Equipped capacity Modules []ModuleInfo `json:"module"` // Module information }
type UserExternalComponent ¶ added in v2.1.0
type UserExternalComponent struct { AccountIdentifier UserName string `json:"user_name"` // Nickname ExternalComponents []ExternalComponentInfo `json:"external_component"` // External component information }
type UserReactor ¶ added in v2.1.0
type UserReactor struct { AccountIdentifier UserName string `json:"user_name"` // Nickname ID string `json:"reactor_id"` // Reactor identifier (Refer to /meta/reactor API) SlotID string `json:"reactor_slot_id"` // Reactor slot identifier Level int64 `json:"reactor_level"` // Reactor level AdditionalStats []ReactorAdditionalStats `json:"reactor_additional_stats"` // Reactor information EnchantLevel int64 `json:"reactor_enchant_level"` // Reactor enchantment level }
type UserWeapon ¶ added in v2.1.0
type UserWeapon struct { AccountIdentifier UserName string `json:"user_name"` // Nickname Weapons []WeaponInfo `json:"weapon"` // Weapon information }
type VoidBattleResponse ¶ added in v2.1.0
type Weapon ¶ added in v2.1.0
type Weapon struct { Name string `json:"weapon_name"` ID string `json:"weapon_id"` ImageURL string `json:"image_url"` Type string `json:"weapon_type"` Tier string `json:"weapon_tier"` Rounds string `json:"weapon_rounds_type"` BaseStat []BaseStat `json:"base_stat"` FireArmATK []FireArmATK `json:"firearm_atk"` PerkAbilityName string `json:"weapon_perk_ability_name"` AbilityDescription string `json:"weapon_perk_ability_description"` AbilityImageURL string `json:"weapon_perk_ability_image_url"` }
type WeaponAdditionalStats ¶ added in v2.1.0
type WeaponInfo ¶ added in v2.1.0
type WeaponInfo struct { ModuleMaxCapacity int64 `json:"module_max_capacity"` // Max. equipable module capacity ModuleCapacity int64 `json:"module_capacity"` // Equipped capacity SlotID string `json:"weapon_slot_id"` // Weapon slot identifier ID string `json:"weapon_id"` // Weapon identifier (Refer to /meta/weapon API) Level int64 `json:"weapon_level"` // Weapon level PerkAbilityEnchantmentLevel int64 `json:"perk_ability_enchant_level"` // Weapon Unique Ability enchantment level AdditionalStats []WeaponAdditionalStats `json:"weapon_additional_stat"` // Weapon random option information Module []ModuleInfo `json:"module"` // Module information }