Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply attaches all APIs to the Gin engine. @param e: the Gin engine. @param autowired: if true, enables property injection via IoC.
func GetAnnotation ¶
GetAnnotation retrieves the specified annotation from the current context. Returns the annotation value and a boolean indicating whether the annotation exists.
func IsController ¶
func IsController(v interface{}) bool
IsController checks if a given value implements the abstractController interface.
Types ¶
type Annotations ¶
Annotations represents the annotations of an API method.
type Controller ¶
type Controller struct{}
Controller is a base struct that declares an entity as a controller. API methods can be added to this struct.
func (*Controller) PostConstruct ¶
func (c *Controller) PostConstruct()
PostConstruct is a default implementation for Controller.
type MethodInterceptor ¶
type MethodInterceptor interface { // Predicate determines whether to intercept the request. Predicate(ctx *gin.Context) bool // PreHandle is triggered before the API method is invoked. // If you want to abort the current request, call ctx.Abort() and handle the response inside this method. PreHandle(ctx *gin.Context) // PostHandle is triggered after the API method is invoked. // If you want to abort the current request, call ctx.Abort() and handle the response inside this method. PostHandle(ctx *gin.Context) }
MethodInterceptor allows for pre- and post-processing of API method calls.