How haegenpro/securelink works
SecureLink is a Go secure-file-transfer backend with two runtime processes. Clients request short-lived upload and download URLs from the API, transfer file bytes directly to private S3, and query file metadata and processing status. S3 object-created events reach the worker through SQS; the worker parses events, applies an idempotent status flow, and acknowledges messages. SQLite stores metadata shared by API and worker. The documented processing step is currently a no-op. Relationships are based on the shown source and README; infrastructure provisioning is outside this runtime view.
Main entry points: handlers.go File handlers · worker.go Worker state machine · sqlite.go SQLite metadata · main.go API process
Components 16
API service
- API process
cmd/api/main.go - HTTP routes
internal/api/server.go - File handlers
internal/api/handlers.go
Event processing
- Worker process
cmd/worker/main.go - Worker state machine
internal/worker/worker.go - S3 event parser
internal/queue/s3event.go - File processor
internal/worker/processor.go
Storage adapters
- SQLite metadata
internal/storage/sqlite/sqlite.go - S3 presigning
internal/storage/s3/s3.go - SQS consumer
internal/queue/sqs/sqs.go
Domain contracts
- Runtime config
internal/config/config.go - File validation and state
internal/domain/file.go - Storage interfaces
internal/storage/storage.go
Other components
- Client
- Amazon S3
- Amazon SQS
Connections 27
- Client → HTTP routes: calls REST
README.md - API process → Runtime config: loads config
cmd/api/main.go - API process → SQLite metadata: opens store
cmd/api/main.go - API process → S3 presigning: configures
cmd/api/main.go - API process → HTTP routes: serves routes
cmd/api/main.go - HTTP routes → File handlers: routes requests
internal/api/server.go - File handlers → File validation and state: validates file
internal/api/handlers.go - File handlers → SQLite metadata: reads/writes metadata
internal/api/handlers.go - File handlers → S3 presigning: requests URLs
internal/api/handlers.go - S3 presigning → Amazon S3: presigns transfers
README.md - File handlers → Client: returns URLs/status
README.md - Client → Amazon S3: transfers bytes
README.md - Amazon S3 → Amazon SQS: sends object events
README.md - Worker process → Runtime config: loads config
cmd/worker/main.go - Worker process → SQLite metadata: opens store
cmd/worker/main.go - Worker process → SQS consumer: configures consumer
cmd/worker/main.go - Worker process → Worker state machine: runs worker
cmd/worker/main.go - SQS consumer → Amazon SQS: polls/deletes messages
README.md - Worker state machine → SQS consumer: receives/acknowledges
internal/worker/worker.go - Worker state machine → S3 event parser: parses bodies
internal/worker/worker.go - Worker state machine → SQLite metadata: reads/updates status
internal/worker/worker.go - Worker state machine → File processor: processes file
internal/worker/worker.go - File processor → File validation and state: accepts file
internal/worker/processor.go - File handlers → Storage interfaces: uses interfaces
internal/api/handlers.go - Worker state machine → Storage interfaces: uses interfaces
internal/worker/worker.go - SQLite metadata → Storage interfaces: implements repository
internal/storage/sqlite/sqlite.go - S3 presigning → Storage interfaces: implements uploader
internal/storage/s3/s3.go