32 lines
706 B
Go
32 lines
706 B
Go
package kernel
|
|
|
|
import (
|
|
"git.vinchent.xyz/vinchent/go-web/framework"
|
|
"git.vinchent.xyz/vinchent/go-web/framework/contract"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type GoWebKernelProvider struct {
|
|
HttpEngine *gin.Engine
|
|
}
|
|
|
|
func (goweb *GoWebKernelProvider) Register(c framework.Container) framework.NewInstance {
|
|
return NewGoWebKernelService
|
|
}
|
|
|
|
func (goweb *GoWebKernelProvider) Init(c framework.Container) error {
|
|
return nil
|
|
}
|
|
|
|
func (goweb *GoWebKernelProvider) InstantiateLater() bool {
|
|
return false
|
|
}
|
|
|
|
func (goweb *GoWebKernelProvider) Params(c framework.Container) []interface{} {
|
|
return []interface{}{c, goweb.HttpEngine}
|
|
}
|
|
|
|
func (goweb *GoWebKernelProvider) Name() string {
|
|
return contract.AppName
|
|
}
|