dubbothrift

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageLenSize       = 4
	MagicLen             = 2
	MessageLenIdx        = 2
	MessageHeaderLenIdx  = 6
	MessageHeaderLenSize = 2
	HeaderIdx            = 9
	HeaderLen            = 9
	IdLen                = 8
)

thrift protocol

View Source
const (
	EventRequest  int = 1 // request
	EventResponse int = 2 // response
)
View Source
const (
	ServiceNameHeader     string = "service"
	MethodNameHeader      string = "method"
	SeqIdNameHeader       string = "seqId"
	MessageTypeNameHeader string = "messageType"
)
View Source
const (
	ProtocolName = "dubbo-thrift"
)
View Source
const (
	ResponseStatusSuccess = uint16(thrift.REPLY)
)
View Source
const (
	UnKnownCmdType string = "unknown cmd type"
)

req/resp type

Variables

View Source
var MagicTag = []byte{0xda, 0xbc}

Functions

This section is empty.

Types

type Frame

type Frame struct {
	Header
	// contains filtered or unexported fields
}

func NewRpcRequest

func NewRpcRequest(headers types.HeaderMap, data types.IoBuffer) *Frame

NewRpcRequest is a utility function which build rpc Request object of bolt protocol.

func NewRpcResponse

func NewRpcResponse(headers types.HeaderMap, data types.IoBuffer) *Frame

NewRpcResponse is a utility function which build rpc Response object of bolt protocol.

func (*Frame) Clone

func (r *Frame) Clone() api.HeaderMap

func (*Frame) GetData

func (r *Frame) GetData() types.IoBuffer

func (*Frame) GetHeader

func (r *Frame) GetHeader() types.HeaderMap

func (*Frame) GetRequestId

func (r *Frame) GetRequestId() uint64

~ XFrame

func (*Frame) GetStatusCode

func (r *Frame) GetStatusCode() uint32

func (*Frame) GetStreamType

func (r *Frame) GetStreamType() xprotocol.StreamType

func (*Frame) IsHeartbeatFrame

func (r *Frame) IsHeartbeatFrame() bool

func (*Frame) SetData

func (r *Frame) SetData(data types.IoBuffer)

func (*Frame) SetRequestId

func (r *Frame) SetRequestId(id uint64)
type Header struct {
	FrameLength   uint32
	Magic         []byte
	MessageLength uint32
	HeaderLength  uint16
	Version       byte
	Id            uint64
	Direction     int
	protocol.CommonHeader
}

Jump to

Keyboard shortcuts

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