Documentation ¶
Index ¶
- func Start(l net.Listener, prefix string, target string) error
- func StartWithInterceptor(l net.Listener, prefix string, target string, interceptor ProxyInterceptor) error
- type BizResp
- type DefaultEventHandler
- type GrpcReq
- type HttpResp
- type NullStruct
- type ProxyHandler
- type ProxyInterceptor
- type RetResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartWithInterceptor ¶
func StartWithInterceptor(l net.Listener, prefix string, target string, interceptor ProxyInterceptor) error
StartWithInterceptor 有中间件功能的代理服务启动
Types ¶
type DefaultEventHandler ¶
type DefaultEventHandler struct {
// contains filtered or unexported fields
}
DefaultEventHandler TODO
func (*DefaultEventHandler) OnReceiveData ¶
func (h *DefaultEventHandler) OnReceiveData(md metadata.MD, resp string, respErr error)
OnReceiveData TODO
func (*DefaultEventHandler) OnReceiveTrailers ¶
func (h *DefaultEventHandler) OnReceiveTrailers(stat *status.Status, md metadata.MD)
OnReceiveTrailers TODO
type HttpResp ¶
type HttpResp struct { RetCode int `json:"retcode"` // 系统错误码 BizCode int `json:"bizcode"` // 业务错误码 TraceID string `json:"trace_id"` // 请求ID Message string `json:"message"` // 错误消息 Payload interface{} `json:"payload"` // 接口内容 }
HttpResp TODO
type ProxyHandler ¶
type ProxyHandler func(ctx context.Context, traceId string, req *GrpcReq, body string, headers []string) *HttpResp
ProxyHandler TODO
Click to show internal directories.
Click to hide internal directories.