Code Monkey home page Code Monkey logo

go-lol's Introduction

go-lol

A new, generated golang client for riot apis.

Install

go get -u github.com/go-lol/go-lol

Features

  • Clean API. See godoc
    • No global variable.
    • Region. (lol.NA == lol.RegionByName("NA"))
  • net/context support.
  • Google app engine support. (My usecase.)
  • (Optional) Batching.
    • API to get single entity.

FAQ

If your question is not listed here, please feel free to make an issue for it.

Can I limit request rate?

No. As API key is per appplication instead of per server, you must use stuffs like task queue to limit it.

Why do you generate instead of writing it by hand?

Rito api really sucks. It's not documented, but they use multiple swagger api manifests internally, and it results in multiple classes with same name. (I'm sure about this as swagger does not support multiple host with a manifest.)

  • No manifest provided.
  • No standard method names.
  • conflicting class names.
  • Response classes change frequently. (As game changes..)

One exception: 'SpellRange' is handwritten becuase

  • Class differs if 'version' parameter changes.
range: { // normal json object,
   self: false,
   ranges: [0, 0, 0, 0] // int
}
range: [0, 0, 0, 0] // int-array only
range: "self" // string. WTF?

See implementation: go-lol-generator/lolregio/datas.go

Build

# If you modify 'SpellRange', you **must** run this first.
go install github.com/go-lol/go-lol
go generate github.com/go-lol/go-lol

License

Apache2

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.