Thanks to visit codestin.com
Credit goes to github.com

Skip to content

kirinyoku/enkanetwork-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnkaNetwork Go API Wrapper

A lightweight, type-safe Go wrapper for the EnkaNetwork API, supporting:

  • Genshin Impact
  • Honkai: Star Rail
  • Zenless Zone Zero

Go Reference License: MIT


Prerequisites

Before using this library, ensure the following:

Installation

go get github.com/kirinyoku/enkanetwork-go@latest

Quick Start

import (
  "context"
  "time"
  "github.com/kirinyoku/enkanetwork-go/client/genshin"
)

func main() {
  ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
  defer cancel()

  client := genshin.NewClient(nil, nil, "my-app/1.0")
  profile, err := client.GetProfile(ctx, "618285856")
  if err != nil {
    // handle error
  }

  // use profile.PlayerInfo, profile.AvatarInfoList, etc.
}

👉 Full, runnable examples are available in the examples/ directory.


Features

  • Multi-game Support: Unified API for all supported games.
  • Type Safety: Strongly typed structs.
  • Context Integration: Pass context.Context for cancellation and timeouts.
  • Caching: Plug-in any Cache implementation to reduce API calls.
  • Error Handling: Rich error types for common scenarios.

Documentation

View detailed API reference on pkg.go.dev.


Examples

Explore examples for each client:

Contributing

This is my first library, and due to my lack of experience, it is far from perfect, so I would welcome your contributions! Here's how you can help.

  1. Bug Reports

    • Open an issue for any bugs you find
    • Include steps to reproduce the issue
    • Provide error messages and relevant code
  2. Feature Requests

    • Open an issue describing the feature
    • Explain why it would be useful
    • Provide examples if possible
  3. Code Contributions

    • Fork the repository
    • Create a feature branch
    • Submit a pull request
    • Include tests for new features

License

Licensed under the MIT License. See LICENSE for details.


Changelog

See CHANGELOG.md for a detailed history of changes.

About

EnkaNetwork Go API Wrapper (supports GI, HSR, and ZZZ).

Topics

Resources

License

Stars

Watchers

Forks

Languages