Giter Site home page Giter Site logo

go-wargaming's People

Contributors

iceflowre avatar kakwa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

go-wargaming's Issues

Add contribution guide

Add more how to contribute information.
Whcih also includes

  • Commit naming convention
  • Which files does what, especially the generator
  • ...

godoc formatting is wrong

From #6

Put also adding // spacing comment lines:

 // realm:
-//     Valid realms: RealmAsia, RealmEu, RealmNa
+//
+//     Valid realms: RealmAsia, RealmEu, RealmNa
+//
 // search:
-//     Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
+//
+//     Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.

[generator] Document how to use the generator in a fork

When fixing the generator (patchs.go fixes), a contributor needs to build the local patched version.

However go build -o generator github.com/IceflowRE/go-wargaming/v4/tools/generator (like instructed in the README) will build the unpatched version from the upstream repository, not the local checkout.

It's possible to build the generator locally (go build -o generator tools/_generator/main.go, but it has other side effects, mainly messing-up the imports:

 import (
-       "github.com/IceflowRE/go-wargaming/v4/wargaming/wgnTime"
+       "/wargaming/wgnTime"
 )

Put also adding // spacing comment lines:

 // realm:
-//     Valid realms: RealmAsia, RealmEu, RealmNa
+//
+//     Valid realms: RealmAsia, RealmEu, RealmNa
+//
 // search:
-//     Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
+//
+//     Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.

My go version:

> go version
go version go1.19.8 linux/amd64

Access to "error", "status" and "meta" fields in responses

Having access to the "error", "status" and "meta" would be really nice.

In particular, the "meta" field can contain pagination information (ex: number of items, number of pages) which are extremely helpful when iterating through paginated lists.

Response payload examples:

  • error:
{
    "status": "error",
    "error": {
        "field": "ship_id",
        "message": "INVALID_SHIP_ID",
        "code": 407,
        "value": "3315513040a"
    }
}
  • status + meta:
{
    "status": "ok",
    "meta": {
      "count": 100,
      "page_total": 7,
      "total": 608,
      "limit": 100,
      "page": 1
    },
    "data": {
        "3315513040": {
            "ship_id": 3315513040,
            "name": "[Zaō]"
        }
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.