Download bootstrap/init_hook.go from bisheng13/nofx13: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/spaces/bisheng13/nofx13/resolve/main/bootstrap/init_hook.go
- Command line
-
hf download hf://spaces/bisheng13/nofx13/bootstrap/init_hook.go
-
curl -L -o init_hook.go https://huggingface.co/spaces/bisheng13/nofx13/resolve/main/bootstrap/init_hook.go
439 Bytes
| package bootstrap | |
| import "nofx/config" | |
| type InitHook func(config *config.Config) error | |
| var InitHooks []InitHook | |
| // RegisterInitHook 注册初始化钩子 | |
| func RegisterInitHook(hook InitHook) { | |
| InitHooks = append(InitHooks, hook) | |
| } | |
| // RunInitHooks 运行所有注册的初始化钩子 | |
| func RunInitHooks(c *config.Config) error { | |
| for _, hookF := range InitHooks { | |
| if err := hookF(c); err != nil { | |
| return err | |
| } | |
| } | |
| return nil | |
| } | |