tars

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdTypeResponse byte   = 0 // cmd type
	CmdTypeRequest  byte   = 1
	CmdTypeUndefine byte   = 2
	UnKnownCmdType  string = "unknown cmd type"
)
View Source
const (
	ServiceNameHeader string = "service"
	MethodNameHeader  string = "method"
)
View Source
const (
	ProtocolName = "tars"
)
View Source
const (
	ResponseStatusSuccess uint16 = 0x00 // 0x00 response status
)

Variables

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

Functions

This section is empty.

Types

type Request

type Request struct {
	protocol.CommonHeader
	// contains filtered or unexported fields
}

func NewRpcRequest

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

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

func (*Request) GetData

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

func (*Request) GetHeader

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

func (*Request) GetRequestId

func (r *Request) GetRequestId() uint64

~ XFrame

func (*Request) GetStreamType

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

func (*Request) IsHeartbeatFrame

func (r *Request) IsHeartbeatFrame() bool

func (*Request) SetData

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

func (*Request) SetRequestId

func (r *Request) SetRequestId(id uint64)

type Response

type Response struct {
	protocol.CommonHeader
	// contains filtered or unexported fields
}

func NewRpcResponse

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

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

func (*Response) GetData

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

func (*Response) GetHeader

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

func (*Response) GetRequestId

func (r *Response) GetRequestId() uint64

~ XFrame

func (*Response) GetStatusCode

func (r *Response) GetStatusCode() uint32

func (*Response) GetStreamType

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

func (*Response) IsHeartbeatFrame

func (r *Response) IsHeartbeatFrame() bool

func (*Response) SetData

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

func (*Response) SetRequestId

func (r *Response) SetRequestId(id uint64)

Jump to

Keyboard shortcuts

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