Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCliProtocolHandler ¶
func RegisterCliProtocolHandler(protocol string, handler CliProtocolHandler)
RegisterCliProtocolHandler registers downstream protocol handler
Types ¶
type CliProtocolHandler ¶
type CliProtocolHandler interface { // WithCtx sets the context header WithCtx(ctx context.Context) (context.Context, error) // GetCliOptions gets specific client options for the request GetCliOptions(ctx context.Context) ([]client.Option, error) // TransReqBody transforms the request body TransReqBody(ctx context.Context) (interface{}, error) // TransRspBody transforms the response body TransRspBody(ctx context.Context) (interface{}, error) // HandleErr handles error information HandleErr(ctx context.Context, err error) error // HandleRspBody handles the response HandleRspBody(ctx context.Context, rspBody interface{}) error }
CliProtocolHandler handles downstream requests based on the downstream client request protocol type
func GetCliProtocolHandler ¶
func GetCliProtocolHandler(protocol string) (CliProtocolHandler, error)
GetCliProtocolHandler gets the downstream protocol handler based on the protocol
Directories
¶
Path | Synopsis |
---|---|
grpc
module
|
|
Package http converts fasthttp requests to net/http requests It refers to the logic of net/http/httputil/reverseproxy.go
|
Package http converts fasthttp requests to net/http requests It refers to the logic of net/http/httputil/reverseproxy.go |
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.