simple http server
zimash / hrenovina Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
Implement several simple prometheus metrics (kind of http response count and duration split by HTTP method, URL and status_code).
All of them should be available via GET /metrics endpoint
It's enough to have there a port to listen. Let's use YAML for configuration file.
Add ability to run tests in Github Actions
You can use https://github.com/stretchr/testify and https://pkg.go.dev/net/http/httptest for HTTP handlers testing.
Accepts body (JSON object):
In case of any invalid data - 400 status code and JSON object:
In case of OK - 200 status code and JSON object:
On start it will contain one table for generated keys with following fields:
It's supposed to use goqu (http://doug-martin.github.io/goqu/) for building SQL queries. So don't use any ORM for it.
You need to add database migrations tool. I know about two:
Database access should be configured via connection string parameter (it can be a server parameter, environment variable or taken from configuration file)
Add linter checks to CI (Github Actions)
Log verbose level can be set in a configuration file.
You can try some third-party libraries.
We need a library which can be used both in handlers or in any console tools for parsing, verifying or generating a new serial keys. It's just a kind of mock so it should be pretty simple. See issue #3 for structure of serial key data.
With endpoint GET /healthz responding with empty JSON object
Input parameters, JSON object:
Success response: 200 status code, JSON object (let's name it Parsed Serial Key)
Invalid serial key string, parsing error: 400 response, JSON object (let's call it Parsing Serial Key Error):
Input - JSON body (similar to response method in issue #3)
Success response: 200 status code, JSON object:
Validation error response: 400 status code, JSON object:
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.