3 route paths
/recently
get currently checked in
/checkin
check-in to any places
input {
"id": 1234,
"place_id": 4321
}
output {
"density": "ok"
}
/checkout
input {
"id": 1234,
"place_id": "4321"
}
output {}
3 tables in db
type TablePeople struct {
ID int64
MobileMo string
}
type TablePlaces struct {
ID int64
Name string
Location Location
Limit int
}
type CacheVisitors struct {
ID int64
PlaceID int64
}
- First version works
- Second version is readable
- Third version is testable
- di by function
- di by interface{}
- logging using uber-zap
- configuration using viper
- routing using gorilla-mux
- graceful shutting down
- distributed tracing using telemetry
traceparent
in header please log it.
payload ewogICAgImlkIjogMTIzNCwKICAgICJwbGFjZV9pZCI6IDQzMjEKfQ==
expect response body eyAiZGVuc2l0eSI6ICJvayIgfQ==
- mux.MiddlewareFunc กับ http.Handler มัน compatability?