// Cleanup is a function does cleanup works
type Cleanup func()
// Moduler is the interface that wraps the module's method.
type Moduler interface {
// Stringer indicates module's name
fmt.Stringer
// Init does initialization works and should return
// a cleanup function.
Init() Cleanup
// Boot boots the module.
Boot()
// RegisterRoutes add routes to fiber router
RegisterRoutes(fiber.Router)
}
类似下面这样
https://github.com/go-dawn/dawn/blob/main/moduler.go https://github.com/go-dawn/dawn/blob/main/sloop.go