Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
Listen 按 Parse 结果监听。文件型 unix 在监听前清理陈旧 socket 文件 (仅当残留文件确实是一个 socket 时才删,避免误删普通文件)。 抽象型 unix(前导 @)与 tcp 直接监听。
func Parse ¶
Parse 把配置字符串解析为 net 包用的 (network, address)。 "unix:/x" → ("unix","/x");"unix:@x" → ("unix","@x");其余 → ("tcp", addr)。
func SelfClient ¶
SelfClient 返回回拨「自己 listen 地址」用的 http.Client 与 base URL。
unix → client 的 DialContext 固定拨该 socket,base = "http://unix" tcp → 普通 client,base = "http://127.0.0.1:<port>"
func UnixHTTPClient ¶
UnixHTTPClient returns an http.Client whose every request is routed to the unix socket named by a "unix:" address (e.g. "unix:/run/gw.sock" or "unix:@name"). Pair it with base URL "http://unix" — the host is ignored.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.