same-calendar-api

command module
v0.0.0-...-3bf5a2b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 4 Imported by: 0

README

same-calendar-api

REST API server that calculates years that have the same calendar.

Installation:

go get -u github.com/lakhanmankani/same-calendar-api

API Usage:

Register

Request:

curl -X POST localhost:8080/api/register

Response:

{
  "key": "9842824a468b7e0a1a01c9d802eb164c568ce3d86c1b7cfa0b80a7eab0379f3e"
}
Get same calendar years in the future

Request:

curl -X GET localhost:8080/api/same-calendar?key=<apikey>&year=2020&n=5&forward=true

Response:

{
  "years": [2020,2048,2076,2116,2144]
}
Get same calendar years in the past

Request:

curl -X GET localhost:8080/api/same-calendar?key=<apikey>&year=2020&n=5&forward=false

Response:

{
  "years": [2020,1992,1964,1936,1908]
}
Unregister

Request:

curl -X DELETE localhost:8080/api/unregister?key=<apikey>

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL