# 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/eut4tiq
拒絕 Go 代碼臃腫,其實在這幾塊可以用下觀察者模式**
今天學習一下用 Go 實現觀察者模式,觀察者模式主要是用來實現事件驅動編程。事件驅動編程的應用還是挺廣的,除了我們都知道的能夠用來解耦:用戶修改密碼後,給用戶發短信進行風險提示之類的典型場景,在微服務架構實現最終一致性、實現事件源(A + ES)這些都會用到。我們先來簡單學習一下用 Go 實現觀察者設計模式,給怎麼實現事件驅動編程、事件源這些模式做個鋪墊。主要也是我也老沒看設計模式了,一起再複習一 ⌘ Read more