Documentation
¶
Index ¶
- Constants
- Variables
- func BitTest(b byte, shift int, expected byte) bool
- func IsAttachmentsPayloadType(typ PayloadType) bool
- type Attachment
- type DubboHeader
- func (h *DubboHeader) Decode(r io.Reader) error
- func (h *DubboHeader) DecodeFromByteSlice(buf []byte) error
- func (h *DubboHeader) Encode(w io.Writer) error
- func (h *DubboHeader) EncodeToByteSlice() []byte
- func (h *DubboHeader) EventByte() byte
- func (h *DubboHeader) OnewayByte() byte
- func (h *DubboHeader) RequestResponseByte() byte
- type PayloadType
- type Service
- type StatusCode
Constants ¶
View Source
const ( PATH_KEY = "path" GROUP_KEY = "group" INTERFACE_KEY = "interface" VERSION_KEY = "version" TIMEOUT_KEY = "timeout" )
View Source
const ( HEADER_SIZE = 16 MAGIC_HIGH = 0xda MAGIC_LOW = 0xbb IS_REQUEST = 1 IS_RESPONSE = 0 REQUEST_BIT_SHIFT = 7 IS_ONEWAY = 0 IS_PINGPONG = 1 ONEWAY_BIT_SHIFT = 6 IS_EVENT = 1 EVENT_BIT_SHIFT = 5 SERIALIZATION_ID_HESSIAN = 2 SERIALIZATION_ID_MASK = 0x1F StatusOK StatusCode = 20 StatusClientTimeout StatusCode = 30 StatusServerTimeout StatusCode = 31 StatusBadRequest StatusCode = 40 StatusBadResponse StatusCode = 50 StatusServiceNotFound StatusCode = 60 StatusServiceError StatusCode = 70 StatusServerError StatusCode = 80 StatusClientError StatusCode = 90 StatusServerPoolExhausted StatusCode = 100 )
View Source
const DEFAULT_DUBBO_PROTOCOL_VERSION = "2.0.2"
Variables ¶
View Source
var ErrInvalidHeader = fmt.Errorf("INVALID HEADER")
Functions ¶
func IsAttachmentsPayloadType ¶
func IsAttachmentsPayloadType(typ PayloadType) bool
IsAttachmentsPayloadType determines whether typ is an attachments PayloadType
Types ¶
type Attachment ¶
type Attachment = map[string]interface{}
func NewAttachment ¶
func NewAttachment(path, group, iface, version string, timeout time.Duration) Attachment
type DubboHeader ¶
type DubboHeader struct {
IsRequest bool // 1 bit
IsOneWay bool // 1 bit
IsEvent bool // 1 bit
SerializationID uint8 // 5 bits
Status StatusCode // 8 bits
RequestID uint64 // 8 bytes
DataLength uint32 // 4 bytes
}
func (*DubboHeader) DecodeFromByteSlice ¶
func (h *DubboHeader) DecodeFromByteSlice(buf []byte) error
func (*DubboHeader) EncodeToByteSlice ¶
func (h *DubboHeader) EncodeToByteSlice() []byte
func (*DubboHeader) EventByte ¶
func (h *DubboHeader) EventByte() byte
func (*DubboHeader) OnewayByte ¶
func (h *DubboHeader) OnewayByte() byte
func (*DubboHeader) RequestResponseByte ¶
func (h *DubboHeader) RequestResponseByte() byte
type PayloadType ¶
type PayloadType int32
const ( RESPONSE_WITH_EXCEPTION PayloadType = iota RESPONSE_VALUE RESPONSE_NULL_VALUE RESPONSE_WITH_EXCEPTION_WITH_ATTACHMENTS RESPONSE_VALUE_WITH_ATTACHMENTS RESPONSE_NULL_VALUE_WITH_ATTACHMENTS )
Response payload type enum
func DecodePayloadType ¶
func DecodePayloadType(decoder iface.Decoder) (PayloadType, error)
type Service ¶
type StatusCode ¶
type StatusCode uint8
Click to show internal directories.
Click to hide internal directories.