dan-tan / riot-cpp Goto Github PK
View Code? Open in Web Editor NEWBasic api client to query riot's api. Handles rate limiting, server errors and does basic logging.
License: MIT License
Basic api client to query riot's api. Handles rate limiting, server errors and does basic logging.
License: MIT License
Clean up includes
Currently, endpoints are chosen by passing string arguements to the RiotApiClient::query() method. This is quite stupid of me as it removes the possibility of compile time errors with endpoint names, so querying non-existent endpoints will throw an invalid arguement runtime error which is not terrible but objectively worse.
Add endpoints such that they are function calls, is the main goal (try reduce boiler code thouhgh).
Add logging...
Exponential Back Off
I tried compiling in local and it shows that string header is missing in client.cpp
/home/ian/code/riot-cpp/src/client/client.cpp: In function ‘size_t client::WriteCallBack_header(void*, size_t, size_t, void*)’:
/home/ian/code/riot-cpp/src/client/client.cpp:76:38: error: ‘strlen’ was not declared in this scope
76 | if (colon_ind == new_chars + strlen(new_chars)) {
| ^~~~~~
/home/ian/code/riot-cpp/src/client/client.cpp:13:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
12 | #include "client.h"
+++ |+#include <cstring>
13 |
/home/ian/code/riot-cpp/src/client/client.cpp:86:74: error: ‘strlen’ was not declared in this scope
86 | new_buffer->insert(new_buffer->end(), &colon_ind[2], new_chars + strlen(new_chars) - 1);
| ^~~~~~
/home/ian/code/riot-cpp/src/client/client.cpp:86:74: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
Develop query dependencies, that take arguments from previous queries to allow for high level requests.
Document endpoint usage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.