engine

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRoute

func FormatRoute(method string, path string) string

Types

type Engine

type Engine struct {
	*gin.Engine

	Routers map[string]ResourceType
	// contains filtered or unexported fields
}

func New

func New() *Engine

func (*Engine) Group

func (e *Engine) Group(relativePath string, handlers ...gin.HandlerFunc) RouterGroupWrapper

type ResourceScope

type ResourceScope string

ResourceScope is the scope of the resource.

type ResourceType

type ResourceType struct {
	// Scope is the scope of the resource.
	Scope ResourceScope `json:"scope"`
	// Resource is the resource name.
	Resource string `json:"resource"`
}

ResourceType used to bind API

type RouterGroupWrapper

type RouterGroupWrapper struct {
	*gin.RouterGroup
	// contains filtered or unexported fields
}

func (RouterGroupWrapper) DELETE

func (rg RouterGroupWrapper) DELETE(relativePath string, typ ResourceType, handlers ...gin.HandlerFunc) gin.IRoutes

func (RouterGroupWrapper) GET

func (rg RouterGroupWrapper) GET(relativePath string, typ ResourceType, handlers ...gin.HandlerFunc) gin.IRoutes

func (RouterGroupWrapper) Group

func (rg RouterGroupWrapper) Group(relativePath string, handlers ...gin.HandlerFunc) RouterGroupWrapper

func (RouterGroupWrapper) PATCH

func (rg RouterGroupWrapper) PATCH(relativePath string, typ ResourceType, handlers ...gin.HandlerFunc) gin.IRoutes

func (RouterGroupWrapper) POST

func (rg RouterGroupWrapper) POST(relativePath string, typ ResourceType, handlers ...gin.HandlerFunc) gin.IRoutes

func (RouterGroupWrapper) PUT

func (rg RouterGroupWrapper) PUT(relativePath string, typ ResourceType, handlers ...gin.HandlerFunc) gin.IRoutes

Jump to

Keyboard shortcuts

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