Skip to content

feat(go-api): wire REST endpoints and external dependencies #14

@Depo-dev

Description

@Depo-dev

Summary

The Go front-office API is an empty HTTP server with no routes or external dependencies. This issue covers wiring the three core REST endpoints backed by the Rust gRPC API.

Acceptance Criteria

Dependencies

  • Add to go.mod: google.golang.org/grpc, generated proto client (or use buf to generate), github.com/jackc/pgx/v5, github.com/redis/go-redis/v9
  • Populate go.sum

REST handlers

  • GET /v1/events — accepts query params contractId, topic0, topic1, ledgerFrom, ledgerTo, cursor, limit; proxies to ListEvents gRPC; returns paginated JSON
  • GET /v1/events/{id} — proxies to GetEvent gRPC; returns single event JSON or 404
  • GET /v1/health — returns {"status":"ok"} with 200

Middleware

  • Request ID middleware (attach UUID to context + response header)
  • Structured JSON logging via log/slog (method, path, status, latency, request_id)

Tests

  • Handler tests for all three endpoints (use httptest)

Files

services/api/main.go, services/api/handlers/ (new), services/api/middleware/ (new)

Metadata

Metadata

Assignees

No one assigned

    Labels

    goGo service workphase-1MVP phase 1 scope

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions