This directory contains example configurations for ETL endpoints demonstrating key features with CQRS pattern separation.
- etl.yml - Main configuration that includes other configs
- etl.users.yml - User query endpoints (4 endpoints: 2 JSON + 2 HTML)
- etl.users_write.yml - User command endpoints (3 endpoints)
- etl.login.yml - Login query endpoints (1 endpoint)
- etl.login_write.yml - Login command endpoints (2 endpoints)
- etl.orders.yml - Order query endpoints (3 endpoints)
- etl.orders_write.yml - Order command endpoints (1 endpoint)
The main etl.yml uses the include: directive to load additional configuration files:
include:
- etl.users.yml
- etl.users_write.yml
- etl.login.yml
- etl.login_write.yml
- etl.orders.yml
- etl.orders_write.ymlAll endpoints from included files are merged into the main configuration. Endpoints are appended in include order.
The etl.users.yml demonstrates HTML template responses alongside JSON:
response:
headers:
"Content-Type": "text/html; charset=utf-8"
template: |
<h1>Users List</h1>
<table border="1" cellpadding="8">
...
<tr v-for="user in users">
<td>{{ user.id }}</td>
...
</tr>
...
</table>- headers: Custom HTTP response headers (optional)
- template: VueGo template string for rendering responses with Vue-like syntax
All endpoints with rateLimit enabled automatically include:
X-RateLimit-Limit: Maximum requests per secondX-RateLimit-Remaining: Burst size
Endpoints demonstrate caching with duration-based invalidation:
cache:
enabled: true
expire: "5m"
keyPattern: "users:all"Validate the configuration loads correctly:
cd tests/users
go test ./...This runs the TestValidateConfig test which verifies:
- Configuration loads successfully with all includes
- Expected 14 endpoints are present (8 query + 6 command with CQRS pattern)
- All endpoints have valid paths and HTTP methods
GET /api/users- List all users (JSON)GET /api/users/{id}- Get user by ID (JSON)GET /users- List all users (HTML table)GET /users/{id}- Get user details (HTML card)
POST /api/users- Create new userPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user
GET /orders- List all orders (JSON)GET /orders/{id}- Get order by ID with user details (JSON)GET /users/{user_id}/orders- Get user's orders (JSON)
POST /orders- Create new order
POST /login- User login
POST /logout- User logoutPOST /refresh-token- Refresh auth token
When multiple config files are included:
- Endpoints: Appended in include order
- Server settings: Later includes override earlier ones
- Storage config: Later includes override earlier ones
- Features: Later includes merge/override with earlier ones