zinterceptor

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

*

  • @author uuxia
  • @date 15:56 2023/3/10
  • @description 责任链模式 *

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 added in v1.1.17

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

GetIMessage Get IMessage from the Chain (从Chain中获取IMessage)

func (*Chain) Proceed

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

func (*Chain) ProceedWithIMessage added in v1.1.17

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

Next Enter the next chain task with IMessage and decoded data,iMessage is the decoded IMessage response is the decoded data (Next 通过IMessage和解码后数据进入下一个责任链任务, iMessage 为解码后的IMessage, response 为解码后的数据)

func (*Chain) Request

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

func (*Chain) ShouldIRequest added in v1.1.17

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

ShouldIRequest Determine if it is IRequest(判断是否是IRequest)

type FrameDecoder

type FrameDecoder struct {
	ziface.LengthField // Basic properties inherited from ILengthField

	LengthFieldEndOffset int // Offset of the end position of the length field (LengthFieldOffset+LengthFieldLength) (长度字段结束位置的偏移量)
	// contains filtered or unexported fields
}

FrameDecoder is a decoder based on the LengthField pattern.

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