ginservice

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 GinService struct {
	*zservice.ZService
	Engine *gin.Engine
}

func NewGinService

func NewGinService(c *GinServiceConfig) *GinService

gin 服务扩展

func (*GinService) GetCtx

func (s *GinService) GetCtx(ctx *gin.Context) *zservice.Context

获取携带的 上下文

func (*GinService) SyncHeader

func (s *GinService) SyncHeader(ctx *gin.Context)

同步 header 信息

type GinServiceConfig

type GinServiceConfig struct {
	ListenPort string            // 监听地址
	OnStart    func(*GinService) // 启动的回调
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL