# 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/a67v33a
用 Option 模式和對接層簡化和管理 Go 項目的外部 API
在項目開發實現功能需求的過程中不可避免的要與外部第三方系統進行交互,這些交互大部分是通過請求 API 接口來完成的。前幾節提到但一直沒帶大家用代碼過一遍的 Lib 層就是負責寫第三方對接邏輯的,通過把跟第三方對接的邏輯限制在 Lib 層裏,讓項目的其他部分不需要關注第三方的邏輯,從而達到每部分都職責分明,這樣項目的代碼多起來後纔不會變得臃腫和雜亂。不過在演示 Lib 層的使用前我們需要先一起給項目 ⌘ Read more