ginmodule

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPWithProxyHeaders

func GetIPWithProxyHeaders(c *gin.Context) string

func GetIPWithValidatedProxyHeaders

func GetIPWithValidatedProxyHeaders(c *gin.Context) string

func Logger

func Logger() gin.HandlerFunc

Logger 是一个自定义的日志中间件

Types

type GinEvent

type GinEvent struct {
	// contains filtered or unexported fields
}

func (*GinEvent) GetEventType

func (ge *GinEvent) GetEventType() event.EventType

type GinModule

type GinModule struct {
	service.Module

	*gin.Engine
	// contains filtered or unexported fields
}

func (*GinModule) AppendDataProcessor

func (gm *GinModule) AppendDataProcessor(processor ...IGinProcessor)

func (*GinModule) DELETE added in v2.0.5

func (gm *GinModule) DELETE(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

DELETE 回调处理是在gin协程中

func (*GinModule) GET added in v2.0.5

func (gm *GinModule) GET(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

GET 回调处理是在gin协程中

func (*GinModule) Init

func (gm *GinModule) Init(addr string, handleTimeout time.Duration, engine *gin.Engine)

func (*GinModule) OnInit

func (gm *GinModule) OnInit() error

func (*GinModule) PATCH added in v2.0.5

func (gm *GinModule) PATCH(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

PATCH 回调处理是在gin协程中

func (*GinModule) POST added in v2.0.5

func (gm *GinModule) POST(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

POST 回调处理是在gin协程中

func (*GinModule) Put added in v2.0.5

func (gm *GinModule) Put(relativePath string, handlers ...gin.HandlerFunc) gin.IRoutes

Put 回调处理是在gin协程中

func (*GinModule) SafeDELETE

func (gm *GinModule) SafeDELETE(relativePath string, handlers ...SafeHandlerFunc) gin.IRoutes

SafeDELETE 回调处理是在service协程中

func (*GinModule) SafeGET

func (gm *GinModule) SafeGET(relativePath string, handlers ...SafeHandlerFunc) gin.IRoutes

SafeGET 回调处理是在service协程中

func (*GinModule) SafePATCH

func (gm *GinModule) SafePATCH(relativePath string, handlers ...SafeHandlerFunc) gin.IRoutes

SafePATCH 回调处理是在service协程中

func (*GinModule) SafePOST

func (gm *GinModule) SafePOST(relativePath string, handlers ...SafeHandlerFunc) gin.IRoutes

SafePOST 回调处理是在service协程中

func (*GinModule) SafePut

func (gm *GinModule) SafePut(relativePath string, handlers ...SafeHandlerFunc) gin.IRoutes

SafePut 回调处理是在service协程中

func (*GinModule) SetupDataProcessor

func (gm *GinModule) SetupDataProcessor(processor ...IGinProcessor)

func (*GinModule) Start

func (gm *GinModule) Start()

func (*GinModule) StartTLS

func (gm *GinModule) StartTLS(certFile, keyFile string)

func (*GinModule) Stop

func (gm *GinModule) Stop(ctx context.Context)

type IGinProcessor added in v2.0.5

type IGinProcessor interface {
	Process(data *gin.Context) (*gin.Context, error)
}

type SafeContext added in v2.0.5

type SafeContext struct {
	*gin.Context
	// contains filtered or unexported fields
}

func (*SafeContext) AsciiJSONAndDone added in v2.0.5

func (c *SafeContext) AsciiJSONAndDone(code int, obj any)

func (*SafeContext) DataAndDone added in v2.0.5

func (c *SafeContext) DataAndDone(code int, contentType string, data []byte)

func (*SafeContext) DataFromReaderAndDone added in v2.0.5

func (c *SafeContext) DataFromReaderAndDone(code int, contentLength int64, contentType string, reader io.Reader, extraHeaders map[string]string)

func (*SafeContext) Done added in v2.0.5

func (c *SafeContext) Done()

func (*SafeContext) HTMLAndDone added in v2.0.5

func (c *SafeContext) HTMLAndDone(code int, name string, obj any)

func (*SafeContext) IndentedJSONAndDone added in v2.0.5

func (c *SafeContext) IndentedJSONAndDone(code int, obj any)

func (*SafeContext) JSONAndDone added in v2.0.5

func (c *SafeContext) JSONAndDone(code int, obj any)

func (*SafeContext) JSONPAndDone added in v2.0.5

func (c *SafeContext) JSONPAndDone(code int, obj any)

func (*SafeContext) ProtoBufAndDone added in v2.0.5

func (c *SafeContext) ProtoBufAndDone(code int, obj any)

func (*SafeContext) PureJSONAndDone added in v2.0.5

func (c *SafeContext) PureJSONAndDone(code int, obj any)

func (*SafeContext) RedirectAndDone added in v2.0.5

func (c *SafeContext) RedirectAndDone(code int, location string)

func (*SafeContext) SecureJSONAndDone added in v2.0.5

func (c *SafeContext) SecureJSONAndDone(code int, obj any)

func (*SafeContext) StringAndDone added in v2.0.5

func (c *SafeContext) StringAndDone(code int, format string, values ...any)

func (*SafeContext) TOMLAndDone added in v2.0.5

func (c *SafeContext) TOMLAndDone(code int, obj any)

func (*SafeContext) XMLAndDone added in v2.0.5

func (c *SafeContext) XMLAndDone(code int, obj any)

func (*SafeContext) YAMLAndDone added in v2.0.5

func (c *SafeContext) YAMLAndDone(code int, obj any)

type SafeHandlerFunc added in v2.0.5

type SafeHandlerFunc func(*SafeContext)

Jump to

Keyboard shortcuts

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