zinterceptor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChain

func NewChain(list []ziface.IInterceptor, pos int, req ziface.IcReq) ziface.IChain

func NewFrameDecoder

func NewFrameDecoder(lf ziface.LengthField) ziface.IFrameDecoder

func NewFrameDecoderByParams

func NewFrameDecoderByParams(maxFrameLength uint64, lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.IFrameDecoder

Types

type Chain

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

func (*Chain) GetIMessage

func (c *Chain) GetIMessage() ziface.IMessage

GetIMessage 从Chain中获取IMessage

func (*Chain) Proceed

func (c *Chain) Proceed(request ziface.IcReq) ziface.IcResp

func (*Chain) ProceedWithIMessage

func (c *Chain) ProceedWithIMessage(iMessage ziface.IMessage, response ziface.IcReq) ziface.IcResp

Next 通过IMessage和解码后数据进入下一个责任链任务 iMessage 为解码后的IMessage response 为解码后的数据

func (*Chain) Request

func (c *Chain) Request() ziface.IcReq

func (*Chain) ShouldIRequest

func (c *Chain) ShouldIRequest(icReq ziface.IcReq) ziface.IRequest

ShouldIRequest 判断是否是IRequest

type FrameDecoder

type FrameDecoder struct {
	ziface.LengthField //从ILengthField集成的基础属性

	LengthFieldEndOffset int //长度字段结束位置的偏移量  LengthFieldOffset+LengthFieldLength
	// contains filtered or unexported fields
}

FrameDecoder 基于LengthField模式的解码器

func (*FrameDecoder) Decode

func (d *FrameDecoder) Decode(buff []byte) [][]byte

Jump to

Keyboard shortcuts

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