Documentation ¶
Overview ¶
Package gwmsg defines gateway message
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PutBackGwMessage ¶
func PutBackGwMessage(sourceMsg GwMsg)
PutBackGwMessage return struct Message to sync pool, and reset all the members of Message to default.
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey 重定义一下key类型,防止字符串定义冲突
const ContextKeyGwMessage ContextKey = "TRPC_GATEWAY_MESSAGE"
ContextKeyGwMessage 网关Msg key
type GwMsg ¶
type GwMsg interface { // WithTargetService sets target service WithTargetService(cli *client.BackendConfig) // TargetService returns target service TargetService() *client.BackendConfig // WithPluginConfig sets plugin configuration WithPluginConfig(name string, config interface{}) // PluginConfig returns plugin configuration, do not make concurrent calls PluginConfig(name string) interface{} // WithRouterID sets router ID WithRouterID(routerID string) // RouterID returns router ID RouterID() string // WithUpstreamLatency sets upstream latency WithUpstreamLatency(latency int64) // UpstreamLatency returns upstream latency UpstreamLatency() int64 // WithUpstreamAddr sets upstream address WithUpstreamAddr(add string) // UpstreamAddr returns upstream address UpstreamAddr() string // WithUpstreamMethod sets upstream method WithUpstreamMethod(method string) // UpstreamMethod returns upstream method UpstreamMethod() string // WithUpstreamRspHead sets upstream ClientRspHead WithUpstreamRspHead(rspHead interface{}) // UpstreamRspHead returns upstream ClientRspHead UpstreamRspHead() interface{} // WithTRPCClientOpts sets trpc client options WithTRPCClientOpts(opts []client.Option) // TRPCClientOpts returns trpc client options TRPCClientOpts() []client.Option }
GwMsg Gateway Msg interface, used for parameter sharing
Click to show internal directories.
Click to hide internal directories.