Pinflow Orbit Integration
Pinflow Orbit is an open-source microservice designed to store real-time geolocation data in-memory. It provides a RESTful API for querying and managing courier location data within the Pinflow platform.
For more details, including comprehensive setup and usage instructions, visit the Pinflow Orbit GitHub Repository (opens in a new tab).
Overview
Pinflow Orbit is a standalone service written in Go, designed to handle live courier location data. It allows the main server to query and update location data using a RESTful API, ensuring efficient and real-time tracking.
Key Features
- In-memory geolocation storage: Fast and efficient data handling.
- RESTful API: Easy integration with existing systems.
- API Key Authentication: Secure access to the service.
API Endpoints
Health Check
-
GET /health
Check if the service is running.
Get All Locations
-
GET /locations
Retrieve all stored locations. Requires API key.
Get Location
-
GET /location
Retrieve a location for a specific user. Requires API key.
- Parameter:
userId
- Parameter:
Set Location
-
POST /set
Set or update a location for a user. Requires API key.
- Request Body:
{ "userId": "user1", "longitude": 10.0, "latitude": 20.0 }
Delete Location
-
POST /delete
Delete a location for a user. Requires API key.
- Request Body:
{ "userId": "user1" }
Getting Started
Prerequisites
- Environment Variable: Set
API_KEY
in your environment to the shared secret key for authentication.
Running the Service
Locally
-
Clone the repository:
git clone https://github.com/katistix/pinflow-orbit.git cd pinflow-orbit
-
Run the service:
go run main.go
Using Docker
-
Build the Docker image:
docker build -t pinflow-orbit .
-
Run the Docker container:
docker run -d -p 8080:8080 --env-file .env pinflow-orbit
Complete Documentation
For more details, including comprehensive setup and usage instructions, visit the Pinflow Orbit GitHub Repository (opens in a new tab).