🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

github.com/andregri/go-restful-sqlite-metrorailapi

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/andregri/go-restful-sqlite-metrorailapi

v0.0.0-20211222153809-134e6d56bf2f
Source
Go
Version published
Created
Source

go-restful-server-ping

api for pinging a server using go-restful

API v1

URLREST VerbActionResource
/pingGETPing the server
/v1/train (details as JSON)POSTCreateTrain
/v1/station (details as JSON)POSTCreateStation
/v1/train/idGETReadTrain
/v1/station/idGETReadStation
/v1/schedule (source and destination as JSON)POSTCreateRoute

Test

curl -X GET http://localhost:8000/ping

2021-12-22 21:34:52.243239244 +0100 CET m=+14.830391099

POST request to create a new train

curl -X POST \
    http://localhost:8000/v1/trains \
    -H 'cache-control: no-cache' \
    -H 'content-type: application/json' \
    -d '{"driverName":"Menaka", "operatingStatus":true}'

{
 "ID": 1,
 "DriverName": "Menaka",
 "OperatingStatus": true
}

GET request of the created train resource

curl -X GET http://localhost:8000/v1/trains/1

{
 "ID": 1,
 "DriverName": "Menaka",
 "OperatingStatus": true
}

DELETE the train resource 1

curl -X DELETE http://localhost:8000/v1/trains/1

If you send a GET request again, the train resource 1 is not found:

curl -X GET http://localhost:8000/v1/trains/1

Train could not be found

FAQs

Package last updated on 22 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts