The Agora Go Backend Middleware is a microservice that exposes a RESTful API designed to simplify interactions with Agora.io. Written in Golang and powered by the Gin framework, this project serves as a middleware to bridge front-end applications using Agora's Real-Time Voice or Video SDKs with Agora's RESTful APIs.
This middleware streamlines the activation of Agora's extension services, such as Cloud Recording, Real-Time Transcription, and Media Services. To enhance security, the project includes a built-in Token Server with public endpoints, based on the AgoraIO Community Token Service, ensuring seamless token generation for services requiring Token Security.
Create a .env
and set the environment variables.
cp .env.example .env
go run cmd/main.go
- GET
/ping
- Response:
{"message": "pong"}
- Response:
flowchart LR
subgraph Client
A[HTTP Client]
end
subgraph "Gin Web Server"
B[Router]
end
subgraph "Core Services"
direction TB
C[Token Service]
D[Cloud Recording Service]
E[Real-Time Transcription Service]
F[RTMP Service]
end
subgraph "External"
K[Agora RESTful API]
end
A <-->|Request/Response| B
B <-->|/token| C
B <-->|/cloud_recording| D
B <-->|/rtt| E
B <-->|/rtmp| F
D & E & F <-.->|API Calls| K
classDef request fill:#f9f,stroke:#333,stroke-width:2px;
classDef response fill:#bbf,stroke:#333,stroke-width:2px;
For detailed API specifications, and curl command examples to test the API endpoints locally, please refer to the following pages:
TokenService
holds the necessary configurations and dependencies for managing tokens.
CloudRecordingService
holds the necessary configurations and dependencies for managing cloud recording requests. This includes Cloud Storage for RTT Service
RTTService
holds all the necessary configurations and dependencies required for managing real-time transcription requestsħ
RTMPService
holds all the necessary configurations and dependencies required for managing media push and cloud player requests.