tcp_proxy_middleware

package
v0.0.0-...-132f7fb Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TCPBlackListMiddleware

func TCPBlackListMiddleware() func(c *TcpSliceRouterContext)

匹配接入方式 基于请求信息

func TCPFlowCountMiddleware

func TCPFlowCountMiddleware() func(c *TcpSliceRouterContext)

func TCPFlowLimitMiddleware

func TCPFlowLimitMiddleware() func(c *TcpSliceRouterContext)

func TCPWhiteListMiddleware

func TCPWhiteListMiddleware() func(c *TcpSliceRouterContext)

匹配接入方式 基于请求信息

Types

type TcpHandlerFunc

type TcpHandlerFunc func(*TcpSliceRouterContext)

知其然也知其所以然

type TcpSliceGroup

type TcpSliceGroup struct {
	*TcpSliceRouter
	// contains filtered or unexported fields
}

group 结构体

func (*TcpSliceGroup) Use

func (g *TcpSliceGroup) Use(middlewares ...TcpHandlerFunc) *TcpSliceGroup

构造回调方法

type TcpSliceRouter

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

router 结构体

func NewTcpSliceRouter

func NewTcpSliceRouter() *TcpSliceRouter

构造 router

func (*TcpSliceRouter) Group

func (g *TcpSliceRouter) Group(path string) *TcpSliceGroup

创建 Group

type TcpSliceRouterContext

type TcpSliceRouterContext struct {
	Ctx context.Context
	*TcpSliceGroup
	// contains filtered or unexported fields
}

router上下文

func (*TcpSliceRouterContext) Abort

func (c *TcpSliceRouterContext) Abort()

跳出中间件方法

func (*TcpSliceRouterContext) Get

func (c *TcpSliceRouterContext) Get(key interface{}) interface{}

func (*TcpSliceRouterContext) IsAborted

func (c *TcpSliceRouterContext) IsAborted() bool

是否跳过了回调

func (*TcpSliceRouterContext) Next

func (c *TcpSliceRouterContext) Next()

从最先加入中间件开始回调

func (*TcpSliceRouterContext) Reset

func (c *TcpSliceRouterContext) Reset()

重置回调

func (*TcpSliceRouterContext) Set

func (c *TcpSliceRouterContext) Set(key, val interface{})

type TcpSliceRouterHandler

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

func NewTcpSliceRouterHandler

func NewTcpSliceRouterHandler(coreFunc func(*TcpSliceRouterContext) tcp_server.TCPHandler, router *TcpSliceRouter) *TcpSliceRouterHandler

func (*TcpSliceRouterHandler) ServeTCP

func (w *TcpSliceRouterHandler) ServeTCP(ctx context.Context, conn net.Conn)

Jump to

Keyboard shortcuts

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