zinterceptor

package
v0.0.0-...-ef14408 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder() ziface.IBuilder

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

func NewInterceptor

func NewInterceptor(maxFrameLength uint64,
	lengthFieldOffset, lengthFieldLength, lengthAdjustment, initialBytesToStrip int) ziface.IInterceptor

Types

type Builder

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

Builder 责任链构造器

func (*Builder) AddInterceptor

func (ic *Builder) AddInterceptor(interceptor ziface.IInterceptor)

func (*Builder) Execute

func (ic *Builder) Execute(req ziface.IcReq) ziface.IcResp

func (*Builder) Head

func (ic *Builder) Head(interceptor ziface.IInterceptor)

func (*Builder) Tail

func (ic *Builder) Tail(interceptor ziface.IInterceptor)

type Chain

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

func (*Chain) Proceed

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

func (*Chain) Request

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

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

type Interceptor

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

Interceptor 基于LengthField规则的拦截器

func (*Interceptor) Intercept

func (l *Interceptor) Intercept(chain ziface.IChain) ziface.IcResp

Jump to

Keyboard shortcuts

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