astrodata-api

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 4 Imported by: 0

README

astro data api

go logo

structure:

.
├── api
│   ├── handlers.go
│   ├── handlers_test.go
│   ├── health
│   │   ├── health.go
│   │   └── health_test.go
│   └── models.go
├── core
│   ├── core.go
│   ├── core_test.go
│   └── parser.go
├── db
│   ├── db.go
│   ├── db_test.go
│   └── models.go
├── go.mod
├── go.sum
├── LICENSE
├── main.go
├── README.md
└── vars
    └── vars.go

api docs

  • this readme file provides an overview and documentation for the astrodata_api application's RESTful API, focusing on the package handlers

  • the API provides access to various space weather data retrieval endpoints:

endpoints:
  • base URL: https://i_dony_have_yet/api
  • health check
GET /health
  • description: checks the health of the API

  • response:

status Code: 200 OK
content-Type: application/json
dst data
  • description: returns dst data for n period
GET /dst/7d
GET /dst/current-month
GET /dst/last-month
GET /dst/now
GET /api/dst/by-date?date=data (YYYYMM format, example: 202306)
GET /dst/now/strength
  • response:
Status Code: 200 OK
Content-Type: application/json
predictions (60% sure)
  • description: calculate and returns the predicted dst index for the next n hours (future predict (60% sure))
GET /predict/6h
GET /predict/1d
  • response:
Status Code: 200 OK
Content-Type: application/json
bz data
  • description: retrieve bz data for n period
GET /bz/6h
GET /bz/1d
GET /bz/3d
GET /bz/7d
GET /api/bz/7d
GET /bz/now
GET /bz/now/strength
plasma temperature data
  • description: retrieve time plasma temperature data for n time period
GET /plasma/now
GET /plasma/2h
GET /plasma/6h
GET /plasma/1d
GET /api/plasma/1d
GET /plasma/3d
GET /api/plasma/3d
GET /plasma/7d
  • error responses
Status Code: 400 Bad Request
Content-Type: application/json
  • example error response:
{
  "error": "date parameter is missing!"
}
{
  "error": "Invalid date format"
}
CORS configs
  • the API is configured to allow Cross-Origin Resource Sharing (CORS) by using the github.com/gin-contrib/cors middleware, enabling access to the API from different domains

  • the API will be available at https://somesite.xyz, make requests to the defined endpoints to access space weather data

  • please ensure that the appropriate URL is used along with any required query parameters when making requests to the API endpoints

contributing

  • pull requests are welcome, for major changes, please open an issue first to discuss what you would like to change

  • please make sure to update tests as appropriate

license

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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