SpringGF

package
v0.0.0-...-37ace14 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWebMapping = NewWebMapping()

DefaultWebMapping 默认的 Web 路由映射表

Functions

This section is empty.

Types

type Mapper

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

Mapper 路由映射器

func NewMapper

func NewMapper(method uint32, path string, fn ghttp.HandlerFunc, filters []SpringWeb.Filter) *Mapper

NewMapper Mapper 的构造函数

func (*Mapper) Filters

func (m *Mapper) Filters() []SpringWeb.Filter

Filters 返回 Mapper 的过滤器列表

func (*Mapper) Handler

func (m *Mapper) Handler() ghttp.HandlerFunc

Handler 返回 Mapper 的处理函数

func (*Mapper) Key

func (m *Mapper) Key() string

Key 返回 Mapper 的标识符

func (*Mapper) Method

func (m *Mapper) Method() uint32

Method 返回 Mapper 的方法

func (*Mapper) Path

func (m *Mapper) Path() string

Path 返回 Mapper 的路径

func (*Mapper) SetFilters

func (m *Mapper) SetFilters(filters []SpringWeb.Filter) *Mapper

SetFilters 设置 Mapper 的过滤器列表

type Mapping

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

Mapping 封装 Web 路由映射

func DeleteMapping

func DeleteMapping(path string, fn ghttp.HandlerFunc) *Mapping

DeleteMapping

func GetMapping

func GetMapping(path string, fn ghttp.HandlerFunc) *Mapping

GetMapping

func NewMapping

func NewMapping(mapper *Mapper) *Mapping

NewMapping Mapping 的构造函数

func PatchMapping

func PatchMapping(path string, fn ghttp.HandlerFunc) *Mapping

PatchMapping

func PostMapping

func PostMapping(path string, fn ghttp.HandlerFunc) *Mapping

PostMapping

func PutMapping

func PutMapping(path string, fn ghttp.HandlerFunc) *Mapping

PutMapping

func RequestMapping

func RequestMapping(method uint32, path string, fn ghttp.HandlerFunc) *Mapping

RequestMapping

func (*Mapping) And

func (m *Mapping) And() *Mapping

And c=a&&b

func (*Mapping) ConditionNot

func (m *Mapping) ConditionNot(cond SpringCore.Condition) *Mapping

ConditionNot 设置一个取反的 Condition

func (*Mapping) ConditionOn

func (m *Mapping) ConditionOn(cond SpringCore.Condition) *Mapping

ConditionOn 设置一个 Condition

func (*Mapping) ConditionOnBean

func (m *Mapping) ConditionOnBean(selector interface{}) *Mapping

ConditionOnBean 设置一个 BeanCondition

func (*Mapping) ConditionOnExpression

func (m *Mapping) ConditionOnExpression(expression string) *Mapping

ConditionOnExpression 设置一个 ExpressionCondition

func (*Mapping) ConditionOnMatches

func (m *Mapping) ConditionOnMatches(fn SpringCore.ConditionFunc) *Mapping

ConditionOnMatches 设置一个 FunctionCondition

func (*Mapping) ConditionOnMissingBean

func (m *Mapping) ConditionOnMissingBean(selector interface{}) *Mapping

ConditionOnMissingBean 设置一个 MissingBeanCondition

func (*Mapping) ConditionOnMissingProperty

func (m *Mapping) ConditionOnMissingProperty(name string) *Mapping

ConditionOnMissingProperty 设置一个 MissingPropertyCondition

func (*Mapping) ConditionOnProfile

func (m *Mapping) ConditionOnProfile(profile string) *Mapping

ConditionOnProfile 设置一个 ProfileCondition

func (*Mapping) ConditionOnProperty

func (m *Mapping) ConditionOnProperty(name string) *Mapping

ConditionOnProperty 设置一个 PropertyCondition

func (*Mapping) ConditionOnPropertyValue

func (m *Mapping) ConditionOnPropertyValue(name string, havingValue interface{}) *Mapping

ConditionOnPropertyValue 设置一个 PropertyValueCondition

func (*Mapping) Doc

func (m *Mapping) Doc() string

Doc 返回接口文档

func (*Mapping) FilterNames

func (m *Mapping) FilterNames() []string

FilterNames 返回过滤器列表

func (*Mapping) Filters

func (m *Mapping) Filters() []SpringWeb.Filter

Filters 返回 Mapper 的过滤器列表

func (*Mapping) Handler

func (m *Mapping) Handler() ghttp.HandlerFunc

Handler 返回 Mapper 的处理函数

func (*Mapping) Key

func (m *Mapping) Key() string

Key 返回 Mapper 的标识符

func (*Mapping) Matches

func (m *Mapping) Matches(ctx SpringCore.SpringContext) bool

Matches 成功返回 true,失败返回 false

func (*Mapping) Method

func (m *Mapping) Method() uint32

Method 返回 Mapper 的方法

func (*Mapping) Or

func (m *Mapping) Or() *Mapping

Or c=a||b

func (*Mapping) Path

func (m *Mapping) Path() string

Path 返回 Mapper 的路径

func (*Mapping) Port

func (m *Mapping) Port() int

Port 返回路由的端口

func (*Mapping) SetDoc

func (m *Mapping) SetDoc(doc string) *Mapping

SetDoc 设置接口文档

func (*Mapping) SetFilterNames

func (m *Mapping) SetFilterNames(filterNames ...string) *Mapping

SetFilterNames 设置过滤器列表

func (*Mapping) SetFilters

func (m *Mapping) SetFilters(filters ...SpringWeb.Filter) *Mapping

Filters 设置 Mapper 的过滤器列表

func (*Mapping) SetPort

func (m *Mapping) SetPort(port int) *Mapping

SetPort 设置路由的端口

type Router

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

Router 路由分组

func NewRouter

func NewRouter(mapping *WebMapping, basePath string) *Router

NewRouter Router 的构造函数

func Route

func Route(basePath string) *Router

Route 返回和 Mapping 绑定的路由分组

func (*Router) And

func (r *Router) And() *Router

And c=a&&b

func (*Router) ConditionNot

func (r *Router) ConditionNot(cond SpringCore.Condition) *Router

ConditionNot 设置一个取反的 Condition

func (*Router) ConditionOn

func (r *Router) ConditionOn(cond SpringCore.Condition) *Router

ConditionOn 设置一个 Condition

func (*Router) ConditionOnBean

func (r *Router) ConditionOnBean(selector interface{}) *Router

ConditionOnBean 设置一个 BeanCondition

func (*Router) ConditionOnExpression

func (r *Router) ConditionOnExpression(expression string) *Router

ConditionOnExpression 设置一个 ExpressionCondition

func (*Router) ConditionOnMatches

func (r *Router) ConditionOnMatches(fn SpringCore.ConditionFunc) *Router

ConditionOnMatches 设置一个 FunctionCondition

func (*Router) ConditionOnMissingBean

func (r *Router) ConditionOnMissingBean(selector interface{}) *Router

ConditionOnMissingBean 设置一个 MissingBeanCondition

func (*Router) ConditionOnMissingProperty

func (r *Router) ConditionOnMissingProperty(name string) *Router

ConditionOnMissingProperty 设置一个 MissingPropertyCondition

func (*Router) ConditionOnProfile

func (r *Router) ConditionOnProfile(profile string) *Router

ConditionOnProfile 设置一个 ProfileCondition

func (*Router) ConditionOnProperty

func (r *Router) ConditionOnProperty(name string) *Router

ConditionOnProperty 设置一个 PropertyCondition

func (*Router) ConditionOnPropertyValue

func (r *Router) ConditionOnPropertyValue(name string, havingValue interface{}) *Router

ConditionOnPropertyValue 设置一个 PropertyValueCondition

func (*Router) DELETE

func (r *Router) DELETE(path string, fn ghttp.HandlerFunc) *Mapping

DELETE 注册 DELETE 方法处理函数

func (*Router) GET

func (r *Router) GET(path string, fn ghttp.HandlerFunc) *Mapping

GET 注册 GET 方法处理函数

func (*Router) HEAD

func (r *Router) HEAD(path string, fn ghttp.HandlerFunc) *Mapping

HEAD 注册 HEAD 方法处理函数

func (*Router) OPTIONS

func (r *Router) OPTIONS(path string, fn ghttp.HandlerFunc) *Mapping

OPTIONS 注册 OPTIONS 方法处理函数

func (*Router) Or

func (r *Router) Or() *Router

Or c=a||b

func (*Router) PATCH

func (r *Router) PATCH(path string, fn ghttp.HandlerFunc) *Mapping

PATCH 注册 PATCH 方法处理函数

func (*Router) POST

func (r *Router) POST(path string, fn ghttp.HandlerFunc) *Mapping

POST 注册 POST 方法处理函数

func (*Router) PUT

func (r *Router) PUT(path string, fn ghttp.HandlerFunc) *Mapping

PUT 注册 PUT 方法处理函数

func (*Router) Request

func (r *Router) Request(method uint32, path string, fn ghttp.HandlerFunc) *Mapping

Request 注册任意 HTTP 方法处理函数

func (*Router) SetFilterNames

func (r *Router) SetFilterNames(filterNames ...string) *Router

SetFilterNames 设置过滤器列表

func (*Router) SetFilters

func (r *Router) SetFilters(filters ...SpringWeb.Filter) *Router

Filters 设置过滤器列表

func (*Router) SetPort

func (r *Router) SetPort(port int) *Router

SetPort 设置路由的端口

type WebMapping

type WebMapping struct {
	Mappings map[string]*Mapping
}

WebMapping Web 路由映射表

func NewWebMapping

func NewWebMapping() *WebMapping

NewWebMapping WebMapping 的构造函数

func (*WebMapping) Request

func (m *WebMapping) Request(method uint32, path string, fn ghttp.HandlerFunc) *Mapping

Request

Jump to

Keyboard shortcuts

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