Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultRPCPath is used by ServeHTTP. DefaultRPCPath = "/_rpcx_" // AuthKey is used in metadata. AuthKey = "__AUTH" )
Variables ¶
View Source
var ( // Codecs are codecs supported by rpcx. You can add customized codecs in Codecs. Codecs = map[protocol.SerializeType]codec.Codec{ protocol.SerializeNone: &codec.ByteCodec{}, protocol.JSON: &codec.JSONCodec{}, protocol.ProtoBuffer: &codec.PBCodec{}, protocol.MsgPack: &codec.MsgpackCodec{}, protocol.Thrift: &codec.ThriftCodec{}, } )
View Source
var ReqMetaDataKey = ContextKey("__req_metadata")
ReqMetaDataKey is used to set metatdata in context of requests.
View Source
var ResMetaDataKey = ContextKey("__res_metadata")
ResMetaDataKey is used to set metatdata in context of responses.
Functions ¶
func RegisterCodec ¶
func RegisterCodec(t protocol.SerializeType, c codec.Codec)
RegisterCodec register customized codec.
Types ¶
Click to show internal directories.
Click to hide internal directories.