Documentation ¶
Index ¶
- Constants
- Variables
- func GetErrorCode(msg *Message) int32
- func IsMetaInvalid(meta *Meta) error
- type ChunkInfo
- type Feedback
- type FrameType
- type Handler
- type Header
- type Message
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)deprecated
- func (x *Meta) GetAttachmentSize() int32
- func (x *Meta) GetAuthenticationData() []byte
- func (x *Meta) GetChunkInfo() *ChunkInfo
- func (x *Meta) GetCompressType() int32
- func (x *Meta) GetCorrelationId() int64
- func (x *Meta) GetRequest() *RequestMeta
- func (x *Meta) GetResponse() *ResponseMeta
- func (x *Meta) GetStreamSettings() *StreamSettings
- func (*Meta) ProtoMessage()
- func (x *Meta) ProtoReflect() protoreflect.Message
- func (x *Meta) Reset()
- func (x *Meta) String() string
- type ReadWriter
- type Reader
- func (r *Reader) GetMaxBodySize() uint32
- func (r *Reader) ReadHeader(rd io.Reader) (Header, error)
- func (r *Reader) ReadMessage(rd io.Reader, h Header) (*Message, error)
- func (r *Reader) ReadMeta(rd io.Reader, metaSize uint32) (*Meta, error)
- func (r *Reader) ReadPackage(rd io.Reader) (Header, *Message, error)
- type RequestMeta
- func (*RequestMeta) Descriptor() ([]byte, []int)deprecated
- func (x *RequestMeta) GetLogId() int64
- func (x *RequestMeta) GetMethodName() string
- func (x *RequestMeta) GetParentSpanId() int64
- func (x *RequestMeta) GetRequestId() string
- func (x *RequestMeta) GetServiceName() string
- func (x *RequestMeta) GetSpanId() int64
- func (x *RequestMeta) GetTimeoutMs() int32
- func (x *RequestMeta) GetTraceId() int64
- func (*RequestMeta) ProtoMessage()
- func (x *RequestMeta) ProtoReflect() protoreflect.Message
- func (x *RequestMeta) Reset()
- func (x *RequestMeta) String() string
- type ResponseMeta
- func (*ResponseMeta) Descriptor() ([]byte, []int)deprecated
- func (x *ResponseMeta) GetErrorCode() int32
- func (x *ResponseMeta) GetErrorText() string
- func (*ResponseMeta) ProtoMessage()
- func (x *ResponseMeta) ProtoReflect() protoreflect.Message
- func (x *ResponseMeta) Reset()
- func (x *ResponseMeta) String() string
- type Router
- type SimpleHandler
- type StreamFrameMeta
- func (*StreamFrameMeta) Descriptor() ([]byte, []int)deprecated
- func (x *StreamFrameMeta) GetFeedback() *Feedback
- func (x *StreamFrameMeta) GetFrameType() FrameType
- func (x *StreamFrameMeta) GetHasContinuation() bool
- func (x *StreamFrameMeta) GetSourceStreamId() int64
- func (x *StreamFrameMeta) GetStreamId() int64
- func (*StreamFrameMeta) ProtoMessage()
- func (x *StreamFrameMeta) ProtoReflect() protoreflect.Message
- func (x *StreamFrameMeta) Reset()
- func (x *StreamFrameMeta) String() string
- type StreamHandler
- type StreamSettings
- func (*StreamSettings) Descriptor() ([]byte, []int)deprecated
- func (x *StreamSettings) GetNeedFeedback() bool
- func (x *StreamSettings) GetStreamId() int64
- func (x *StreamSettings) GetWritable() bool
- func (*StreamSettings) ProtoMessage()
- func (x *StreamSettings) ProtoReflect() protoreflect.Message
- func (x *StreamSettings) Reset()
- func (x *StreamSettings) String() string
Constants ¶
View Source
const ( CompressTypeNo int32 = 0 CompressTypeSnappy int32 = 1 CompressTypeGzip int32 = 2 )
View Source
const (
ErrorCodeUnknown int32 = -255
)
Variables ¶
View Source
var ( ErrInvalidProtocol = errors.New("invalid protocol") ErrInvalidHeader = errors.New("invalid header") ErrInvalidMeta = errors.New("invalid meta") )
View Source
var ( FrameType_name = map[int32]string{ 0: "Unknown", 1: "Rst", 2: "Close", 3: "Data", 4: "FeedBack", } FrameType_value = map[string]int32{ "Unknown": 0, "Rst": 1, "Close": 2, "Data": 3, "FeedBack": 4, } )
Enum value maps for FrameType.
View Source
var ErrBodyTooLarge = errors.New("body size is too large")
View Source
var ErrCompressUnknown = errors.New("unsupported compress type")
View Source
var ErrMethodNotFound = errors.New("service or method not found")
View Source
var File_brpc_proto protoreflect.FileDescriptor
View Source
var File_streaming_proto protoreflect.FileDescriptor
View Source
var MaxBodySize = uint32(10 << 20)
MaxBodySize 默认的最大 body 大小
Functions ¶
func GetErrorCode ¶
func IsMetaInvalid ¶
Types ¶
type ChunkInfo ¶
type ChunkInfo struct { StreamId int64 `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` ChunkId int64 `protobuf:"varint,2,opt,name=chunk_id,json=chunkId,proto3" json:"chunk_id,omitempty"` // contains filtered or unexported fields }
func (*ChunkInfo) Descriptor
deprecated
func (*ChunkInfo) GetChunkId ¶
func (*ChunkInfo) GetStreamId ¶
func (*ChunkInfo) ProtoMessage ¶
func (*ChunkInfo) ProtoMessage()
func (*ChunkInfo) ProtoReflect ¶
func (x *ChunkInfo) ProtoReflect() protoreflect.Message
type Feedback ¶
type Feedback struct { ConsumedSize int64 `protobuf:"varint,1,opt,name=consumed_size,json=consumedSize,proto3" json:"consumed_size,omitempty"` // contains filtered or unexported fields }
func (*Feedback) Descriptor
deprecated
func (*Feedback) GetConsumedSize ¶
func (*Feedback) ProtoMessage ¶
func (*Feedback) ProtoMessage()
func (*Feedback) ProtoReflect ¶
func (x *Feedback) ProtoReflect() protoreflect.Message
type FrameType ¶
type FrameType int32
func (FrameType) Descriptor ¶
func (FrameType) Descriptor() protoreflect.EnumDescriptor
func (FrameType) EnumDescriptor
deprecated
func (FrameType) Number ¶
func (x FrameType) Number() protoreflect.EnumNumber
func (FrameType) Type ¶
func (FrameType) Type() protoreflect.EnumType
type Header ¶
func (Header) PayloadSize ¶
type Meta ¶
type Meta struct { Request *RequestMeta `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` Response *ResponseMeta `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` CompressType int32 `protobuf:"varint,3,opt,name=compress_type,json=compressType,proto3" json:"compress_type,omitempty"` CorrelationId int64 `protobuf:"varint,4,opt,name=correlation_id,json=correlationId,proto3" json:"correlation_id,omitempty"` AttachmentSize int32 `protobuf:"varint,5,opt,name=attachment_size,json=attachmentSize,proto3" json:"attachment_size,omitempty"` ChunkInfo *ChunkInfo `protobuf:"bytes,6,opt,name=chunk_info,json=chunkInfo,proto3" json:"chunk_info,omitempty"` AuthenticationData []byte `protobuf:"bytes,7,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` StreamSettings *StreamSettings `protobuf:"bytes,8,opt,name=stream_settings,json=streamSettings,proto3" json:"stream_settings,omitempty"` // contains filtered or unexported fields }
func (*Meta) Descriptor
deprecated
func (*Meta) GetAttachmentSize ¶
func (*Meta) GetAuthenticationData ¶
func (*Meta) GetChunkInfo ¶
func (*Meta) GetCompressType ¶
func (*Meta) GetCorrelationId ¶
func (*Meta) GetRequest ¶
func (x *Meta) GetRequest() *RequestMeta
func (*Meta) GetResponse ¶
func (x *Meta) GetResponse() *ResponseMeta
func (*Meta) GetStreamSettings ¶
func (x *Meta) GetStreamSettings() *StreamSettings
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type ReadWriter ¶
type Reader ¶
type Reader struct { // MaxBodySize 可选,最大 Body 大小,为 0 是会使用 全局变量 MaxBodySize MaxBodySize uint32 }
func (*Reader) GetMaxBodySize ¶
type RequestMeta ¶
type RequestMeta struct { ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` LogId int64 `protobuf:"varint,3,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` TraceId int64 `protobuf:"varint,4,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` SpanId int64 `protobuf:"varint,5,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` ParentSpanId int64 `protobuf:"varint,6,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"` RequestId string `protobuf:"bytes,7,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // correspond to x-request-id in http header TimeoutMs int32 `protobuf:"varint,8,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"` // client's timeout setting for current call // contains filtered or unexported fields }
func (*RequestMeta) Descriptor
deprecated
func (*RequestMeta) Descriptor() ([]byte, []int)
Deprecated: Use RequestMeta.ProtoReflect.Descriptor instead.
func (*RequestMeta) GetLogId ¶
func (x *RequestMeta) GetLogId() int64
func (*RequestMeta) GetMethodName ¶
func (x *RequestMeta) GetMethodName() string
func (*RequestMeta) GetParentSpanId ¶
func (x *RequestMeta) GetParentSpanId() int64
func (*RequestMeta) GetRequestId ¶
func (x *RequestMeta) GetRequestId() string
func (*RequestMeta) GetServiceName ¶
func (x *RequestMeta) GetServiceName() string
func (*RequestMeta) GetSpanId ¶
func (x *RequestMeta) GetSpanId() int64
func (*RequestMeta) GetTimeoutMs ¶
func (x *RequestMeta) GetTimeoutMs() int32
func (*RequestMeta) GetTraceId ¶
func (x *RequestMeta) GetTraceId() int64
func (*RequestMeta) ProtoMessage ¶
func (*RequestMeta) ProtoMessage()
func (*RequestMeta) ProtoReflect ¶
func (x *RequestMeta) ProtoReflect() protoreflect.Message
func (*RequestMeta) Reset ¶
func (x *RequestMeta) Reset()
func (*RequestMeta) String ¶
func (x *RequestMeta) String() string
type ResponseMeta ¶
type ResponseMeta struct { ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` ErrorText string `protobuf:"bytes,2,opt,name=error_text,json=errorText,proto3" json:"error_text,omitempty"` // contains filtered or unexported fields }
func (*ResponseMeta) Descriptor
deprecated
func (*ResponseMeta) Descriptor() ([]byte, []int)
Deprecated: Use ResponseMeta.ProtoReflect.Descriptor instead.
func (*ResponseMeta) GetErrorCode ¶
func (x *ResponseMeta) GetErrorCode() int32
func (*ResponseMeta) GetErrorText ¶
func (x *ResponseMeta) GetErrorText() string
func (*ResponseMeta) ProtoMessage ¶
func (*ResponseMeta) ProtoMessage()
func (*ResponseMeta) ProtoReflect ¶
func (x *ResponseMeta) ProtoReflect() protoreflect.Message
func (*ResponseMeta) Reset ¶
func (x *ResponseMeta) Reset()
func (*ResponseMeta) String ¶
func (x *ResponseMeta) String() string
type SimpleHandler ¶
type StreamFrameMeta ¶
type StreamFrameMeta struct { StreamId int64 `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` SourceStreamId int64 `protobuf:"varint,2,opt,name=source_stream_id,json=sourceStreamId,proto3" json:"source_stream_id,omitempty"` FrameType FrameType `protobuf:"varint,3,opt,name=frame_type,json=frameType,proto3,enum=brpc.FrameType" json:"frame_type,omitempty"` HasContinuation bool `protobuf:"varint,4,opt,name=has_continuation,json=hasContinuation,proto3" json:"has_continuation,omitempty"` Feedback *Feedback `protobuf:"bytes,5,opt,name=feedback,proto3" json:"feedback,omitempty"` // contains filtered or unexported fields }
func (*StreamFrameMeta) Descriptor
deprecated
func (*StreamFrameMeta) Descriptor() ([]byte, []int)
Deprecated: Use StreamFrameMeta.ProtoReflect.Descriptor instead.
func (*StreamFrameMeta) GetFeedback ¶
func (x *StreamFrameMeta) GetFeedback() *Feedback
func (*StreamFrameMeta) GetFrameType ¶
func (x *StreamFrameMeta) GetFrameType() FrameType
func (*StreamFrameMeta) GetHasContinuation ¶
func (x *StreamFrameMeta) GetHasContinuation() bool
func (*StreamFrameMeta) GetSourceStreamId ¶
func (x *StreamFrameMeta) GetSourceStreamId() int64
func (*StreamFrameMeta) GetStreamId ¶
func (x *StreamFrameMeta) GetStreamId() int64
func (*StreamFrameMeta) ProtoMessage ¶
func (*StreamFrameMeta) ProtoMessage()
func (*StreamFrameMeta) ProtoReflect ¶
func (x *StreamFrameMeta) ProtoReflect() protoreflect.Message
func (*StreamFrameMeta) Reset ¶
func (x *StreamFrameMeta) Reset()
func (*StreamFrameMeta) String ¶
func (x *StreamFrameMeta) String() string
type StreamHandler ¶
type StreamSettings ¶
type StreamSettings struct { StreamId int64 `protobuf:"varint,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` NeedFeedback bool `protobuf:"varint,2,opt,name=need_feedback,json=needFeedback,proto3" json:"need_feedback,omitempty"` Writable bool `protobuf:"varint,3,opt,name=writable,proto3" json:"writable,omitempty"` // contains filtered or unexported fields }
func (*StreamSettings) Descriptor
deprecated
func (*StreamSettings) Descriptor() ([]byte, []int)
Deprecated: Use StreamSettings.ProtoReflect.Descriptor instead.
func (*StreamSettings) GetNeedFeedback ¶
func (x *StreamSettings) GetNeedFeedback() bool
func (*StreamSettings) GetStreamId ¶
func (x *StreamSettings) GetStreamId() int64
func (*StreamSettings) GetWritable ¶
func (x *StreamSettings) GetWritable() bool
func (*StreamSettings) ProtoMessage ¶
func (*StreamSettings) ProtoMessage()
func (*StreamSettings) ProtoReflect ¶
func (x *StreamSettings) ProtoReflect() protoreflect.Message
func (*StreamSettings) Reset ¶
func (x *StreamSettings) Reset()
func (*StreamSettings) String ¶
func (x *StreamSettings) String() string
Click to show internal directories.
Click to hide internal directories.