Documentation ¶
Index ¶
- Constants
- Variables
- type Frame
- func (r *Frame) Clone() api.HeaderMap
- func (r *Frame) GetData() types.IoBuffer
- func (r *Frame) GetHeader() types.HeaderMap
- func (r *Frame) GetRequestId() uint64
- func (r *Frame) GetStatusCode() uint32
- func (r *Frame) GetStreamType() api.StreamType
- func (r *Frame) GetTimeout() int32
- func (r *Frame) IsHeartbeatFrame() bool
- func (r *Frame) SetData(data types.IoBuffer)
- func (r *Frame) SetRequestId(id uint64)
- type Header
- type Metadata
- type Node
- type XCodec
Constants ¶
const ( HeaderLen = 16 IdLen = 8 MagicIdx = 0 FlagIdx = 2 StatusIdx = 3 IdIdx = 4 DataLenIdx = 12 DataLenSize = 4 )
dubbo protocol
const ( CmdTypeResponse byte = 0 // cmd type CmdTypeRequest byte = 1 CmdTypeRequestOneway byte = 2 UnKnownCmdType string = "unknown cmd type" )
req/resp type
const ( RespStatusOK = 20 RespStatusClientTimeout = 30 RespStatusServerTimeout = 31 RespStatusBadRequest = 40 RespStatusBadResponse = 50 RespStatusServiceNotFound = 60 RespStatusServiceError = 70 RespStatusServerError = 80 RespStatusClientError = 90 RespStatusServerThreadpoolExhaustedError = 100 )
* https://dubbo.apache.org/zh/docs/v2.7/dev/implementation/#%E8%BF%9C%E7%A8%8B%E9%80%9A%E8%AE%AF%E7%BB%86%E8%8A%82 * 20 - OK * 30 - CLIENT_TIMEOUT * 31 - SERVER_TIMEOUT * 40 - BAD_REQUEST * 50 - BAD_RESPONSE * 60 - SERVICE_NOT_FOUND * 70 - SERVICE_ERROR * 80 - SERVER_ERROR * 90 - CLIENT_ERROR * 100 - SERVER_THREADPOOL_EXHAUSTED_ERROR
const ( EventRequest int = 1 // request EventResponse int = 0 // response )
const ( FrameworkVersionNameHeader string = "dubbo" ServiceNameHeader string = "service" MethodNameHeader string = "method" VersionNameHeader string = "version" GroupNameHeader string = "group" InterfaceNameHeader string = "interface" )
const ( EgressDubbo string = "egress_dubbo" IngressDubbo string = "ingress_dubbo" )
const (
ProtocolName api.ProtocolName = "dubbo"
)
const (
ResponseStatusSuccess uint16 = 0x14 // 0x14 response status
)
Variables ¶
var DubboPubMetadata = &Metadata{}
DubboPubMetadata dubbo pub cache metadata
var DubboSubMetadata = &Metadata{}
DubboSubMetadata dubbo sub cache metadata
var MagicTag = []byte{0xda, 0xbb}
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { Header // contains filtered or unexported fields }
func NewRpcRequest ¶
NewRpcRequest is a utility function which build rpc Request object of bolt protocol.
func NewRpcResponse ¶
NewRpcResponse is a utility function which build rpc Response object of bolt protocol.
func (*Frame) GetStatusCode ¶
func (*Frame) GetStreamType ¶
func (r *Frame) GetStreamType() api.StreamType
func (*Frame) GetTimeout ¶ added in v0.22.0
dubbo frame returns default timeout TODO: use dubbo timeout?
func (*Frame) IsHeartbeatFrame ¶
func (*Frame) SetRequestId ¶
type Header ¶
type Header struct { Magic []byte Flag byte Status byte Id uint64 DataLen uint32 IsEvent bool // true: heartbeat or readonly event IsTwoWay bool // true: send request and expect response, false: just request without response Direction int // 1 mean req SerializationId int // 2 mean hessian protocol.CommonHeader }
type Metadata ¶ added in v0.13.0
type Metadata struct {
// contains filtered or unexported fields
}
Metadata cache service pub or sub metadata. speed up for decode or encode dubbo performance. please do not use outside of the dubbo framework.
func (*Metadata) Contains ¶ added in v0.13.0
Contains check if cached pub or sub metadata strict exists. caller should check match is true
type Node ¶ added in v0.13.0
type Node struct { Service string // interface name Version string // interface version Group string // interface group Next *Node // next node // contains filtered or unexported fields }
Node pub or sub host metadata, Keep the structure as simple as possible.
type XCodec ¶ added in v0.26.0
type XCodec struct {
// contains filtered or unexported fields
}
func (*XCodec) HTTPMapping ¶ added in v0.26.0
func (codec *XCodec) HTTPMapping() api.HTTPMapping
TODO: not implement yet.
func (*XCodec) NewXProtocol ¶ added in v0.26.0
func (*XCodec) ProtocolMatch ¶ added in v0.26.0
func (codec *XCodec) ProtocolMatch() api.ProtocolMatch
func (*XCodec) ProtocolName ¶ added in v0.26.0
func (codec *XCodec) ProtocolName() api.ProtocolName