How lkorsman/nonce-app works
This is a small Go HTTP service for issuing and consuming single-use nonces. A client posts to the issue endpoint to receive a nonce and TTL, then posts that nonce to consume it; the service reports validity and distinguishes missing, expired, and reused tokens. The in-memory store also purges old entries on a ticker. The graph is based on the sampled source; no README was provided, and optional middleware such as request content-type enforcement is not shown as active.
Main entry points: main.go Server bootstrap · middleware.go HTTP middleware · handlers.go Issue endpoint · store.go Nonce store
Components 6
HTTP runtime
- Server bootstrap
server/main.go - HTTP middleware
server/middleware.go
Nonce API
- Issue endpoint
server/handlers.go - Consume endpoint
server/handlers.go
Nonce state
- Nonce store
server/store.go
Other components
- HTTP client
Connections 9
- HTTP client → Server bootstrap: sends HTTP
server/main.go - Server bootstrap → HTTP middleware: registers routes
server/main.go - Server bootstrap → Issue endpoint: routes issue
server/main.go - Server bootstrap → Consume endpoint: routes consume
server/main.go - Issue endpoint → Nonce store: issues nonce
server/handlers.go - Consume endpoint → Nonce store: consumes nonce
server/handlers.go - Server bootstrap → Nonce store: purges periodically
server/main.go - HTTP middleware → Issue endpoint: wraps handler
- HTTP middleware → Consume endpoint: wraps handler