controller

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	InitRouter(*gin.RouterGroup) *gin.RouterGroup
}

type Controllers

type Controllers struct {
	Base        string
	Handlers    []gin.HandlerFunc
	Controllers []Controller
}

func (*Controllers) AddController

func (s *Controllers) AddController(c ...Controller)

func (*Controllers) AddHandler

func (s *Controllers) AddHandler(h ...gin.HandlerFunc)

func (*Controllers) InitRouter

func (s *Controllers) InitRouter(r *gin.RouterGroup) *gin.RouterGroup

interface Controller

type ResourceController

type ResourceController struct {
	Controllers
	ResourceHandlers []ResourceHandler
}

func (*ResourceController) InitRouter

func (c *ResourceController) InitRouter(r *gin.RouterGroup) *gin.RouterGroup

func (*ResourceController) RegisterResourceHandler

func (c *ResourceController) RegisterResourceHandler(h ...ResourceHandler)

func (*ResourceController) RegisterRoute

func (c *ResourceController) RegisterRoute(httpMethod string, path string, handler gin.HandlerFunc)

func (*ResourceController) SetResourceHandlers

func (c *ResourceController) SetResourceHandlers(handlers []ResourceHandler)

type ResourceHandler

type ResourceHandler struct {
	HttpMethod   string
	ResourcePath string
	Handler      gin.HandlerFunc
}

Jump to

Keyboard shortcuts

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