parent
973d88e77c
commit
34d8a15f06
@ -1,16 +0,0 @@ |
|||||||
package app |
|
||||||
|
|
||||||
import "github.com/labstack/echo/v4" |
|
||||||
|
|
||||||
type Applet interface { |
|
||||||
// Init 初始化服务
|
|
||||||
Init(ctx *Context) error |
|
||||||
// Start 启动服务
|
|
||||||
Start() error |
|
||||||
// Stop 停止服务
|
|
||||||
Stop() error |
|
||||||
} |
|
||||||
|
|
||||||
type Routable interface { |
|
||||||
InitRoutes(r *echo.Group) |
|
||||||
} |
|
@ -0,0 +1,20 @@ |
|||||||
|
package app |
||||||
|
|
||||||
|
import "github.com/labstack/echo/v4" |
||||||
|
|
||||||
|
type Service interface { |
||||||
|
// Name 服务名称
|
||||||
|
Name() string |
||||||
|
// Priority 优先级,用于启动和销毁的执行顺序
|
||||||
|
Priority() int |
||||||
|
// Init 初始化服务
|
||||||
|
Init(ctx *Context) error |
||||||
|
// Bootstrap 启动服务
|
||||||
|
Bootstrap() error |
||||||
|
// Destroy 销毁服务
|
||||||
|
Destroy() error |
||||||
|
} |
||||||
|
|
||||||
|
type Routable interface { |
||||||
|
InitRoutes(r *echo.Group) |
||||||
|
} |
Loading…
Reference in new issue