dubbo_spec

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 BitTest

func BitTest(b byte, shift int, expected byte) bool

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) Decode

func (h *DubboHeader) Decode(r io.Reader) error

func (*DubboHeader) DecodeFromByteSlice

func (h *DubboHeader) DecodeFromByteSlice(buf []byte) error

func (*DubboHeader) Encode

func (h *DubboHeader) Encode(w io.Writer) 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 Service struct {
	ProtocolVersion string
	Path            string
	Version         string
	Method          string
	Timeout         time.Duration
	Group           string
}

func (*Service) Decode

func (svc *Service) Decode(decoder iface.Decoder) error

type StatusCode

type StatusCode uint8

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL