23 lines
473 B
Go
23 lines
473 B
Go
|
package kernel
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
type GoWebKernelService struct {
|
||
|
// Since the container is included in the engine, we don't need to pass
|
||
|
// it as an argument.
|
||
|
engine *gin.Engine
|
||
|
}
|
||
|
|
||
|
func NewGoWebKernelService(params ...interface{}) (interface{}, error) {
|
||
|
httpEngine := params[0].(*gin.Engine)
|
||
|
return &GoWebKernelService{engine: httpEngine}, nil
|
||
|
}
|
||
|
|
||
|
func (goweb *GoWebKernelService) HttpEngine() http.Handler {
|
||
|
return goweb.engine
|
||
|
}
|