go-tfd-client
is a Go client library for interacting with "The First Descendant" game API. This client wraps all the API endpoints listed in the NEXON Open API documentation, providing an easy-to-use interface for Go developers to integrate with the game's services.
- Full coverage of all API endpoints.
- Easy-to-use and idiomatic Go interface.
- Support for authentication and authorization.
To install the library, use the following command:
go get github.com/DevZoneLabs/go-tfd-client/v2
Here is a basic example of how to use the client:
package main
import (
"fmt"
"log"
"net/http"
tfd "github.com/DevZoneLabs/go-tfd-client"
)
func main() {
// Initialize the client without an API key
client := tfd.NewClient()
// Set your API key using SetAccessKey
client.SetAccessKey("YOUR_API_KEY")
// Optionally, you can set a custom HTTP client
customHTTPClient := &http.Client{}
client.CustomHTTPClient(customHTTPClient)
// Example: Get AccountIdentifier
accIdentifier, err := client.GetAccountIdentifier("PLAYER_ID")
if err != nil {
log.Fatalf("Error fetching account identifier: %v", err)
}
fmt.Printf("Account Identifier: %s\n", accIdentifier.OUID)
}
Full documentation is available on GoDocs v2
The client covers the following API endpoints:
-
GetAccountIdentifier(userName string) (*models.AccountIdentifier, error)
-
GetUserInfo(ouid string) (*UserBasic, error)
-
GetUserDescendant(ouid string) (*models.UserDescendant, error)
-
GetUserWeapons(ouid string, language LanguageCode) (*models.UserWeapon, error)
-
GetUserReactor(ouid string, language LanguageCode) (*models.UserReactor, error)
-
GetExternalComponent(ouid string, language LanguageCode) (*models.UserExternalComponent, error)
-
GetDescendantsMetadata(language LanguageCode) ([]models.Descendant, error)
-
GetWeaponsMetadata(language LanguageCode) ([]models.Weapon, error)
-
GetModulesMetadata(language LanguageCode) ([]models.Module, error)
-
GetReactorsMetadata(language LanguageCode) ([]models.Reactor, error)
-
GetExternalComponentsMetadata(language LanguageCode) ([]models.ExternalComponent, error)
-
GetRewardsMetadata(language LanguageCode) ([]models.Reward, error)
-
GetStatsMetadata(language LanguageCode) ([]models.StatMeta, error)
-
GetVoidBattlesMetadata(language LanguageCode) (*models.VoidBattleResponse, error)
-
GetVoidBattlesMetadata(language LanguageCode) (*models.VoidBattleResponse, error)
-
GetTitlesMetadata(language LanguageCode) (*models.TitleResponse, error)
- GetModuleRecommendation(opts ModuleRecommendationOpts) (*models.ModuleRecommendationResponse, error)