tcp_proxy_middleware

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TCPBlacListMiddleware

func TCPBlacListMiddleware() func(c *TcpSliceRouterContext)

func TCPFlowCountMiddleware

func TCPFlowCountMiddleware() func(c *TcpSliceRouterContext)

func TCPFlowLimitMiddleware

func TCPFlowLimitMiddleware() func(c *TcpSliceRouterContext)

func TCPWhileListMiddleware

func TCPWhileListMiddleware() func(c *TcpSliceRouterContext)

Types

type TcpHandlerFunc

type TcpHandlerFunc func(*TcpSliceRouterContext)

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 NewTcpSliceRouter

func NewTcpSliceRouter() *TcpSliceRouter

NewTcpSliceRouter 构造 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 router上下文

func (*TcpSliceRouterContext) Abort

func (c *TcpSliceRouterContext) Abort()

Abort 跳出中间件方法

func (*TcpSliceRouterContext) Get

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

func (*TcpSliceRouterContext) IsAborted

func (c *TcpSliceRouterContext) IsAborted() bool

IsAborted 是否跳过了回调

func (*TcpSliceRouterContext) Next

func (c *TcpSliceRouterContext) Next()

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

func (*TcpSliceRouterContext) Reset

func (c *TcpSliceRouterContext) Reset()

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