codec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2016 License: Apache-2.0 Imports: 15 Imported by: 66

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ColferSizeMax is the upper limit for serial byte sizes.
	ColferSizeMax = 16 * 1024 * 1024
)

Colfer configuration attributes

Functions

func NewBsonClientCodec

func NewBsonClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewBsonClientCodec creates a bson ClientCodec

func NewBsonServerCodec

func NewBsonServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewBsonServerCodec creates a bson ServerCodec

func NewColferClientCodec

func NewColferClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewColferClientCodec creates a bson ClientCodec

func NewColferServerCodec

func NewColferServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewColferServerCodec creates a bson ServerCodec

func NewGencodeClientCodec

func NewGencodeClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewGencodeClientCodec creates a gencode ClientCodec

func NewGencodeServerCodec

func NewGencodeServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewGencodeServerCodec creates a gencode ServerCodec

func NewGobClientCodec

func NewGobClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewGobClientCodec creates a gob ClientCodec

func NewGobServerCodec

func NewGobServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewGobServerCodec creates a gob ServerCodec

func NewJSONRPC2ClientCodec

func NewJSONRPC2ClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewJSONRPC2ClientCodec creates a RPC-JSON 2.0 ClientCodec

func NewJSONRPC2ServerCodec

func NewJSONRPC2ServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewJSONRPC2ServerCodec creates a RPC-JSON 2.0 ServerCodec

func NewJSONRPCClientCodec

func NewJSONRPCClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewJSONRPCClientCodec creates a RPC-JSON 2.0 ClientCodec

func NewJSONRPCServerCodec

func NewJSONRPCServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewJSONRPCServerCodec creates a RPC-JSON 2.0 ServerCodec

func NewProtobufClientCodec

func NewProtobufClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewProtobufClientCodec creates a protobuf ClientCodec by https://github.com/mars9/codec

func NewProtobufServerCodec

func NewProtobufServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewProtobufServerCodec creates a protobuf ServerCodec by https://github.com/mars9/codec

Types

type ColferError

type ColferError int

ColferError signals a data mismatch as as a byte index.

func (ColferError) Error

func (i ColferError) Error() string

Error honors the error interface.

type ColferMax

type ColferMax string

ColferMax signals an upper limit breach.

func (ColferMax) Error

func (m ColferMax) Error() string

Error honors the error interface.

type ColferTail

type ColferTail int

ColferTail signals data continuation as a byte index.

func (ColferTail) Error

func (i ColferTail) Error() string

Error honors the error interface.

type RequestHeader

type RequestHeader struct {
	Method string
	Seq    uint64
}

func (*RequestHeader) MarshalBinary

func (o *RequestHeader) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is codec.ColferMax.

func (*RequestHeader) MarshalLen

func (o *RequestHeader) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is codec.ColferMax.

func (*RequestHeader) MarshalTo

func (o *RequestHeader) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*RequestHeader) Reset

func (o *RequestHeader) Reset()

Reset this object

func (*RequestHeader) Unmarshal

func (o *RequestHeader) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, codec.ColferError and codec.ColferMax.

func (*RequestHeader) UnmarshalBinary

func (o *RequestHeader) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, codec.ColferError, codec.ColferTail and codec.ColferMax.

type ResponseHeader

type ResponseHeader struct {
	Method string
	Seq    uint64
	Error  string
}

func (*ResponseHeader) MarshalBinary

func (o *ResponseHeader) MarshalBinary() (data []byte, err error)

MarshalBinary encodes o as Colfer conform encoding.BinaryMarshaler. The error return option is codec.ColferMax.

func (*ResponseHeader) MarshalLen

func (o *ResponseHeader) MarshalLen() (int, error)

MarshalLen returns the Colfer serial byte size. The error return option is codec.ColferMax.

func (*ResponseHeader) MarshalTo

func (o *ResponseHeader) MarshalTo(buf []byte) int

MarshalTo encodes o as Colfer into buf and returns the number of bytes written. If the buffer is too small, MarshalTo will panic.

func (*ResponseHeader) Reset

func (o *ResponseHeader) Reset()

Reset this object

func (*ResponseHeader) Unmarshal

func (o *ResponseHeader) Unmarshal(data []byte) (int, error)

Unmarshal decodes data as Colfer and returns the number of bytes read. The error return options are io.EOF, codec.ColferError and codec.ColferMax.

func (*ResponseHeader) UnmarshalBinary

func (o *ResponseHeader) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes data as Colfer conform encoding.BinaryUnmarshaler. The error return options are io.EOF, codec.ColferError, codec.ColferTail and codec.ColferMax.

Jump to

Keyboard shortcuts

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