outbound

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveHandler

func RemoveHandler(ctx context.Context, traceID string)

func Start

func Start(addr *net.TCPAddr)

func StoreHandler

func StoreHandler(ctx context.Context, traceID string)

Types

type ConnState

type ConnState struct {
	LastMatchedIndex int

	*Handler
	// contains filtered or unexported fields
}

ConnState 连接管理

func (*ConnState) ProcessRequest

func (cs *ConnState) ProcessRequest(ctx context.Context, requestID int) bool

ProcessRequest 处理请求, false:关闭conn,true:保持conn

type Handler

type Handler struct {
	Ctx              context.Context    // 串联日志
	Matcher          match.MatcherIf    // 匹配引擎
	ReplayingSession *replaying.Session // 待匹配session
	ReplayedSession  *replayed.Session  // 记录匹配详细信息
}

type Proxyer

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

Proxyer Proxyer

func NewProxyer

func NewProxyer(srcConn *net.TCPConn) *Proxyer

NewProxyer 新建代理

func (*Proxyer) Close

func (p *Proxyer) Close()

Close 关闭代理

func (*Proxyer) Write

func (p *Proxyer) Write(ctx context.Context, proxyAddr string, request []byte) error

Write 往代理连接写数据

type Server

type Server struct {
	sync.Mutex
	Handlers map[string]*Handler
}
var OutboundServer Server

Jump to

Keyboard shortcuts

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