server-http

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

samples/server-http/main.go

Demonstra o bloco de servidor HTTP com roteamento, middleware e integração com os demais blocos (DynamoDB, Redis, bloco de decisão).

Endpoints expostos:

GET  /health                    → health check
GET  /users/:id                 → busca usuário (Redis cache → DynamoDB)
POST /users                     → cria usuário (CEL valida tipo PJ/PF)
GET  /users/:id/orders          → lista pedidos do usuário
DELETE /users/:id               → remove usuário + invalida cache

Variáveis de ambiente:

PORT            porta HTTP (default: 8080)
AWS_REGION      região AWS (default: us-east-1)
USERS_TABLE     tabela DynamoDB (default: users-dev)
REDIS_ADDR      endereço Redis (default: localhost:6379)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL