Discover Packages
github.com/ggwhite/4x
internal
hook
package
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Jul 8, 2026
License: MIT
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
ToEvent 將 hook Result 轉成 protocol.Event,供寫入 events.jsonl。
Timestamp 留空,AppendEvent 會自動補 RFC3339。
type Result struct {
Command string `json:"command"`
ExitCode int `json:"exitCode"`
Status string `json:"status"`
Duration float64 `json:"duration"`
LogFile string `json:"logFile,omitempty"`
}
Result 記錄單一 hook 的執行結果。
Execute 依序執行 hooks,logDir 用來存放 stdout/stderr output 檔。
遇到 on_fail=block 的 hook 失敗時立即停止並回傳 error;
on_fail=warn 的 hook 失敗只記錄 result,不中止後續執行。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.