ginmodule

package
v2.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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

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

DELETE 回调处理是在gin协程中

func (*GinModule) GET

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

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

PATCH 回调处理是在gin协程中

func (*GinModule) POST

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

POST 回调处理是在gin协程中

func (*GinModule) Put

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

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

type SafeContext

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

func (*SafeContext) AsciiJSONAndDone

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

func (*SafeContext) DataAndDone

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

func (*SafeContext) DataFromReaderAndDone

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

func (*SafeContext) Done

func (c *SafeContext) Done()

func (*SafeContext) HTMLAndDone

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

func (*SafeContext) IndentedJSONAndDone

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

func (*SafeContext) JSONAndDone

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

func (*SafeContext) JSONPAndDone

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

func (*SafeContext) ProtoBufAndDone

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

func (*SafeContext) PureJSONAndDone

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

func (*SafeContext) RedirectAndDone

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

func (*SafeContext) SecureJSONAndDone

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

func (*SafeContext) StringAndDone

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

func (*SafeContext) TOMLAndDone

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

func (*SafeContext) XMLAndDone

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

func (*SafeContext) YAMLAndDone

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

type SafeHandlerFunc

type SafeHandlerFunc func(*SafeContext)

Jump to

Keyboard shortcuts

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