Communication Layer

REST & Search API

High-performance, tenant-aware JSON endpoints powered by Gin Gonic and GORM.

Entity-Specific CRUD

Standard strongly-typed controllers for every entity. Includes built-in caching, MQTT eventing, and multi-tenancy.

GET /api/articles
GET /api/articles/:id?eager=true

Generic Search RPC

A single, ultra-flexible engine mirroring PostgREST. Filter by any column using powerful operators WITHOUT writing code.

GET /api/rpc/articles?status=eq.PUBLISHED
GET /api/rpc/articles?id=gt.100&order=id.desc

Standard Controller Features

📦 Eager vs. Lazy Loading

By default, entities are loaded Lazily (IDs only for foreign keys). To perform a Join and fetch the full object graph, use the eager parameter.

Lazy (Default)

GET /api/article/1

Eager (Joined)

GET /api/article/1?eager=true

📏 Offset Pagination

All collection endpoints support built-in pagination to keep your frontend lightning fast.

Parameter Description Default
pageThe index of the page to fetch0
sizeNumber of records per page20

Distributed Redis Shield

Every GetByID request is automatically protected by a Redis cache layer. Mutations (Create/Update/Delete) trigger Automatic Cache Invalidation across the cluster, ensuring data consistency with zero effort.

Generic Search RPC Engine

Accessed via /api/rpc/:tableName, this engine provides a dynamic interface to your database.

# Complex query example
curl -X GET "http://localhost:8080/api/rpc/articles?status=eq.PUBLISHED&views=gt.500&order=views.desc&limit=5"
Supported Operators
eqEquals
neqNot Equals
gt / gteGreater Than
lt / lteLess Than
likeSearch (%)
ilikeCase-Insensitive
inList (1,2,3)

Security & Context

Mandatory Headers

Every Go-Duck API request must satisfy the Identity and Multi-Tenancy gatekeepers.

  • Authorization: Bearer <Keycloak_JWT>
  • X-Tenant-ID: Subdomain or ID of the tenant dashboard