detection

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Overview

Package detection protocol detection, it is used for a scenario that switching KitexProtobuf to gRPC. No matter KitexProtobuf or gRPC the server side can handle with this detection handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSvrTransHandlerFactory

func NewSvrTransHandlerFactory(defaultHandlerFactory remote.ServerTransHandlerFactory,
	detectableHandlerFactory ...remote.ServerTransHandlerFactory,
) remote.ServerTransHandlerFactory

NewSvrTransHandlerFactory detection factory construction. Each detectableHandlerFactory should return a ServerTransHandler which implements DetectableServerTransHandler after called NewTransHandler.

Types

type DetectableServerTransHandler added in v0.6.0

type DetectableServerTransHandler interface {
	remote.ServerTransHandler
	ProtocolMatch(ctx context.Context, conn net.Conn) (err error)
}

DetectableServerTransHandler implements an additional method ProtocolMatch to help DetectionHandler to judge which serverHandler should handle the request data.

Jump to

Keyboard shortcuts

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