Documentation ¶
Index ¶
- Constants
- func DefResJson(code uint32, msg ...any) map[string]any
- func GetContext(c *gin.Context) *zservice.Context
- func GinMiddlewareCORS(zs *zservice.ZService) gin.HandlerFunc
- func GinMiddlewareContext(zs *zservice.ZService) gin.HandlerFunc
- func ReadUploadFile(file *multipart.FileHeader) ([]byte, *zservice.Error)
- func SyncHeader(c *gin.Context)
- type GinService
- type GinServiceConfig
Constants ¶
View Source
const (
GIN_contextEX_Middleware_Key = "__gin_contextEX_Middleware_Key"
)
Variables ¶
This section is empty.
Functions ¶
func GinMiddlewareCORS ¶
func GinMiddlewareCORS(zs *zservice.ZService) gin.HandlerFunc
中间件 CORS跨域中间件
func GinMiddlewareContext ¶
func GinMiddlewareContext(zs *zservice.ZService) gin.HandlerFunc
扩展 Context 中间件
func ReadUploadFile ¶
func ReadUploadFile(file *multipart.FileHeader) ([]byte, *zservice.Error)
读取上传的文件信息
Types ¶
type GinService ¶
type GinServiceConfig ¶
type GinServiceConfig struct { Port int // 监听端口 OnStart func(*GinService) // 启动的回调 }
Click to show internal directories.
Click to hide internal directories.