Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlowCountMiddleWare ¶
func FlowCountMiddleWare(counter *public.FlowCountService) func(c *TCPSliceRouterContext)
FlowCountMiddleWare TCP 限流中间件
func IPWhiteListMiddleWare ¶
func IPWhiteListMiddleWare() func(c *TCPSliceRouterContext)
IPWhiteListMiddleWare TCP 权限认证中间件 定义了一份IP白名单,这里是设置127.0.0.1这个 IP 可以通过验证
Types ¶
type TCPSliceGroup ¶
type TCPSliceGroup struct { *TCPSliceRouter // contains filtered or unexported fields }
TCPSliceGroup group 结构体
func (*TCPSliceGroup) Use ¶
func (g *TCPSliceGroup) Use(middlewares ...TCPHandlerFunc) *TCPSliceGroup
Use 构造回调方法
type TCPSliceRouter ¶
type TCPSliceRouter struct {
// contains filtered or unexported fields
}
TCPSliceRouter router 结构体
func (*TCPSliceRouter) Group ¶
func (g *TCPSliceRouter) Group(path string) *TCPSliceGroup
Group 创建 Group
type TCPSliceRouterContext ¶
type TCPSliceRouterContext struct { Ctx context.Context *TCPSliceGroup // contains filtered or unexported fields }
TCPSliceRouterContext 上下文
func (*TCPSliceRouterContext) Get ¶
func (c *TCPSliceRouterContext) Get(key interface{}) interface{}
Get 获取上下文的值
func (*TCPSliceRouterContext) IsAbort ¶
func (c *TCPSliceRouterContext) IsAbort() bool
IsAbort 是否跳过了回调方法
func (*TCPSliceRouterContext) Set ¶
func (c *TCPSliceRouterContext) Set(key, val interface{})
Set 设置上下文的值
type TCPSliceRouterHandler ¶
type TCPSliceRouterHandler struct {
// contains filtered or unexported fields
}
TCPSliceRouterHandler description
func NewTCPSliceRouterHandler ¶
func NewTCPSliceRouterHandler(coreFunc func(*TCPSliceRouterContext) tcpproxy.TCPHandler, router *TCPSliceRouter) *TCPSliceRouterHandler
NewTCPSliceRouterHandler 创建 TCP 路由处理器
Click to show internal directories.
Click to hide internal directories.