refactor: 文件结构调整

This commit is contained in:
tiglog 2023-08-16 07:27:49 +08:00
parent 3ecd10b367
commit 74c9bf36fd
2 changed files with 26 additions and 18 deletions

View File

@ -16,26 +16,8 @@ import (
"os/signal" "os/signal"
"syscall" "syscall"
"time" "time"
"github.com/gin-gonic/gin"
) )
type Engine = gin.Engine
type Context = gin.Context
type H = gin.H
const (
ReleaseMode = gin.ReleaseMode
DebugMode = gin.DebugMode
TestMode = gin.TestMode
)
var New = gin.New
var SetMode = gin.SetMode
var Mode = gin.Mode
func RunWeb(app *Engine, addr string) { func RunWeb(app *Engine, addr string) {
if addr[0] == ':' { if addr[0] == ':' {
addr = "127.0.0.1" + addr addr = "127.0.0.1" + addr

26
gweb/wrapper.go Normal file
View File

@ -0,0 +1,26 @@
//
// wrapper.go
// Copyright (C) 2023 tiglog <me@tiglog.com>
//
// Distributed under terms of the MIT license.
//
package gweb
import "github.com/gin-gonic/gin"
type Engine = gin.Engine
type Context = gin.Context
type H = gin.H
const (
ReleaseMode = gin.ReleaseMode
DebugMode = gin.DebugMode
TestMode = gin.TestMode
)
var New = gin.New
var SetMode = gin.SetMode
var Mode = gin.Mode