How 0jk6/triemap works
Main Components
a) HTTP Server Layer
• Entry point (main.go)
• REST API endpoints (/store, /get, /prefix, /suffix)
b) Handler Layer (internal/handlers)
• Request processing
• Response formatting
• API route handling
c) Core Components
• Trie Data Structure (internal/trie)
• Cache System (internal/cache)
• Utility Functions (internal/utils)
┌─ Client Layer ─────┐
• HTTP Requests │
• ┬────────┘
• ↓
┌─ API Layer ───────┐
• REST Endpoints │
• ┬────────┘
• ↓
┌─ Handler Layer ───┐
• Request Processing│
• ┬────────┘
• ↓
┌─ Core Layer ──────┐
• ┌─────┐ ┌─────┐ │
• Cache│ │Trie │ │
• ┘ └─────┘ │
• ┘
Data Flow Representation
• Client requests → HTTP endpoints
• HTTP endpoints → Handlers
• Handlers → Core components (Trie/Cache)
• Return paths for responses
Component Details
For each component, include:
• Component name
• Primary responsibilities
• Interactions with other components
Technical Specifications
• Go version requirement (>=1.22)
• Port number (8080)
• Supported HTTP methods (GET, POST)
• Data format (JSON)