MCPcopy
hub / github.com/larksuite/cli / init

Function init

extension/platform/examples/audit-observer/main.go:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func init() {
27 platform.Register(
28 platform.NewPlugin("audit", "0.1.0").
29 Observer(platform.After, "log", platform.All(),
30 func(ctx context.Context, inv platform.Invocation) {
31 path := inv.Cmd().Path()
32 if err := inv.Err(); err != nil {
33 fmt.Fprintf(os.Stderr, "[audit] %s FAILED: %v\n", path, err)
34 } else {
35 log.Printf("[audit] %s ok", path)
36 }
37 }).
38 FailOpen().
39 MustBuild())
40}
41
42func main() {
43 os.Exit(cmd.Execute())

Callers

nothing calls this directly

Calls 9

RegisterFunction · 0.92
NewPluginFunction · 0.92
AllFunction · 0.92
MustBuildMethod · 0.80
FailOpenMethod · 0.80
ObserverMethod · 0.80
PathMethod · 0.65
CmdMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected