📦
Fast Time Server Go
Fast time server written in go
0 installs
Trust: 34 — Low
Devtools
Ask AI about Fast Time Server Go
Powered by Claude · Grounded in docs
I know everything about Fast Time Server Go. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Loading tools...
Reviews
Documentation
🦫 Fast Time Server
Author: Mihai Criveti A minimal Go service that streams or returns the current UTC time over stdio, HTTP/JSON-RPC, or Server‑Sent Events (SSE).
Features
- Three transports:
stdio,http(JSON‑RPC 2.0), andsse - Single static binary (~2 MiB)
- Build-time version & date via
main.appVersion,main.buildDate - Cross-platform builds via
make cross - Dockerfile for lightweight container
- Linting (
golangci-lint,staticcheck) and pre-commit support - Unit tests with HTML coverage & Go benchmarks
- Load testing support using
hey
Quick Start
git clone https://github.com/yourorg/fast-time-server.git
cd fast-time-server
# Build & run over stdio
make run
# HTTP JSON‑RPC on port 8080
make run-http
# SSE endpoint on port 8080
make run-sse
Installation
Requires Go 1.23+.
go install github.com/yourorg/fast-time-server@latest
Also available as releases.
CLI Flags
| Flag | Default | Description |
|---|---|---|
-transport | stdio | Options: stdio, http, sse, dual |
-addr/-listen | 0.0.0.0 | Bind address for HTTP/SSE |
-port | 8080 | Port for HTTP/SSE/dual |
-auth-token | (empty) | Bearer token for SSE authentication |
API Reference
HTTP (JSON‑RPC 2.0)
POST /http
Request:
{"jsonrpc":"2.0","method":"Time.Now","id":1}
Response:
{"jsonrpc":"2.0","result":"2025-06-21T12:34:56Z","id":1}
SSE
GET /sse (optional header: Authorization: Bearer <token>)
Outputs UTC timestamps every second:
data: 2025-06-21T12:34:56Z
Load Testing
Install the popular HTTP load tester hey:
brew install hey # macOS
wget https://hey-release... # Linux prebuilt binary
Run a quick load test:
# 500 requests total, 50 concurrent, HTTP transport
hey -n 500 -c 50 http://localhost:8080/http
Generate detailed CSV output for analysis:
hey -n 1000 -c 100 -o csv http://localhost:8080/http > results.csv
Docker
make docker-build
make docker-run # HTTP mode
Cross‑Compilation
make cross
Binaries appear under dist/fast-time-server-<os>-<arch>.
Development
| Task | Command |
|---|---|
| Format & tidy | make fmt tidy |
| Lint & vet | make lint staticcheck vet |
| Run pre‑commit hooks | make pre-commit |
Testing & Benchmarking
make test # Unit tests (race detection)
make coverage # HTML coverage report
make bench # Go benchmarks
