# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 1
# self = https://watcher.sour.is/conv/vqvvnja
Gin 增加超時控制中間件**
背景--有時候很多 API 有業務超時要求,就是數據必須在幾秒內返回,超時的話立刻結束,不用卡死在某一個頁面上。 目標--對這一類 API 特定處理,增加超時控制,不要影響別的 API 方案--方案很簡單,就是利用 go 提供的 context 技術對 gin 框架的 request 對象進行改造,使其具備超時控制機能。 代碼:package mainimport ( "cont ⌘ Read more