wire

package
v0.0.0-...-6538a59 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package wire is a generated protocol buffer package.

protorpc wire format wrapper

0. Frame Format
len : uvarint64
data: byte[len]

1. Client Send Request
Send RequestHeader: sendFrame(conn, hdr, len(hdr))
Send Request: sendFrame(conn, body, len(body))

2. Server Recv Request
Recv RequestHeader: recvFrame(conn, hdr, max_hdr_len, 0)
Recv Request: recvFrame(conn, body)

3. Server Send Response
Send ResponseHeader: sendFrame(conn, hdr, len(hdr))
Send Response: sendFrame(conn, body, len(body))

4. Client Recv Response
Recv ResponseHeader: recvFrame(conn, hdr, max_hdr_len, 0)
Recv Response: recvFrame(conn, body)

It is generated from these files:

cockroach/rpc/codec/wire/wire.proto

It has these top-level messages:

RequestHeader
ResponseHeader

Index

Constants

This section is empty.

Variables

View Source
var CompressionType_name = map[int32]string{
	0: "NONE",
	1: "SNAPPY",
	2: "LZ4",
}
View Source
var CompressionType_value = map[string]int32{
	"NONE":   0,
	"SNAPPY": 1,
	"LZ4":    2,
}

Functions

This section is empty.

Types

type CompressionType

type CompressionType int32
const (
	CompressionType_NONE   CompressionType = 0
	CompressionType_SNAPPY CompressionType = 1
	CompressionType_LZ4    CompressionType = 2
)

func (CompressionType) Enum

func (x CompressionType) Enum() *CompressionType

func (CompressionType) String

func (x CompressionType) String() string

func (*CompressionType) UnmarshalJSON

func (x *CompressionType) UnmarshalJSON(data []byte) error

type RequestHeader

type RequestHeader struct {
	Id               uint64          `protobuf:"varint,1,opt,name=id" json:"id"`
	Method           *string         `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"`
	MethodId         int32           `protobuf:"varint,3,opt,name=method_id" json:"method_id"`
	Compression      CompressionType `protobuf:"varint,4,opt,name=compression,enum=cockroach.rpc.codec.wire.CompressionType" json:"compression"`
	UncompressedSize uint32          `protobuf:"varint,5,opt,name=uncompressed_size" json:"uncompressed_size"`
	XXX_unrecognized []byte          `json:"-"`
}

func (*RequestHeader) GetCompression

func (m *RequestHeader) GetCompression() CompressionType

func (*RequestHeader) GetId

func (m *RequestHeader) GetId() uint64

func (*RequestHeader) GetMethod

func (m *RequestHeader) GetMethod() string

func (*RequestHeader) GetMethodId

func (m *RequestHeader) GetMethodId() int32

func (*RequestHeader) GetUncompressedSize

func (m *RequestHeader) GetUncompressedSize() uint32

func (*RequestHeader) Marshal

func (m *RequestHeader) Marshal() (data []byte, err error)

func (*RequestHeader) MarshalTo

func (m *RequestHeader) MarshalTo(data []byte) (n int, err error)

func (*RequestHeader) ProtoMessage

func (*RequestHeader) ProtoMessage()

func (*RequestHeader) Reset

func (m *RequestHeader) Reset()

func (*RequestHeader) Size

func (m *RequestHeader) Size() (n int)

func (*RequestHeader) String

func (m *RequestHeader) String() string

func (*RequestHeader) Unmarshal

func (m *RequestHeader) Unmarshal(data []byte) error

type ResponseHeader

type ResponseHeader struct {
	Id               uint64          `protobuf:"varint,1,opt,name=id" json:"id"`
	Method           *string         `protobuf:"bytes,2,opt,name=method" json:"method,omitempty"`
	Error            string          `protobuf:"bytes,3,opt,name=error" json:"error"`
	Compression      CompressionType `protobuf:"varint,4,opt,name=compression,enum=cockroach.rpc.codec.wire.CompressionType" json:"compression"`
	UncompressedSize uint32          `protobuf:"varint,5,opt,name=uncompressed_size" json:"uncompressed_size"`
	XXX_unrecognized []byte          `json:"-"`
}

func (*ResponseHeader) GetCompression

func (m *ResponseHeader) GetCompression() CompressionType

func (*ResponseHeader) GetError

func (m *ResponseHeader) GetError() string

func (*ResponseHeader) GetId

func (m *ResponseHeader) GetId() uint64

func (*ResponseHeader) GetMethod

func (m *ResponseHeader) GetMethod() string

func (*ResponseHeader) GetUncompressedSize

func (m *ResponseHeader) GetUncompressedSize() uint32

func (*ResponseHeader) Marshal

func (m *ResponseHeader) Marshal() (data []byte, err error)

func (*ResponseHeader) MarshalTo

func (m *ResponseHeader) MarshalTo(data []byte) (n int, err error)

func (*ResponseHeader) ProtoMessage

func (*ResponseHeader) ProtoMessage()

func (*ResponseHeader) Reset

func (m *ResponseHeader) Reset()

func (*ResponseHeader) Size

func (m *ResponseHeader) Size() (n int)

func (*ResponseHeader) String

func (m *ResponseHeader) String() string

func (*ResponseHeader) Unmarshal

func (m *ResponseHeader) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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