burrow: github.com/hyperledger/burrow/encoding Index | Files | Directories

package encoding

import "github.com/hyperledger/burrow/encoding"


Package Files

encoding.pb.go protobuf.go


var (
    ErrInvalidLengthEncoding        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowEncoding          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupEncoding = fmt.Errorf("proto: unexpected end of group")

func Decode Uses

func Decode(bs []byte, msg proto.Message) error

Single shot decoding

func Encode Uses

func Encode(msg proto.Message) ([]byte, error)

Single shot encoding

func ReadMessage Uses

func ReadMessage(r io.Reader, pb proto.Message) (int, error)

Read messages with length-prefix framing from the provided Reader. Returns the number of bytes read and io.EOF if ReadMessage is called exactly on the end of a stream.

func WriteMessage Uses

func WriteMessage(w io.Writer, pb proto.Message) (int, error)

Write messages with length-prefix framing to the provider Writer. Returns the number of bytes written.

type Buffer Uses

type Buffer struct {

func NewBuffer Uses

func NewBuffer(bs []byte) *Buffer

Centralise proto.Buffer constructor. gogo protobuf freaks out about deterministic marshalling on objects with custom marshallers so we use google protobuf here

type TestMessage Uses

type TestMessage struct {
    Type                 uint32   `protobuf:"varint,1,opt,name=Type,proto3" json:"Type,omitempty"`
    Amount               uint64   `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`

For testing

func (*TestMessage) Descriptor Uses

func (*TestMessage) Descriptor() ([]byte, []int)

func (*TestMessage) GetAmount Uses

func (m *TestMessage) GetAmount() uint64

func (*TestMessage) GetType Uses

func (m *TestMessage) GetType() uint32

func (*TestMessage) Marshal Uses

func (m *TestMessage) Marshal() (dAtA []byte, err error)

func (*TestMessage) MarshalTo Uses

func (m *TestMessage) MarshalTo(dAtA []byte) (int, error)

func (*TestMessage) MarshalToSizedBuffer Uses

func (m *TestMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TestMessage) ProtoMessage Uses

func (*TestMessage) ProtoMessage()

func (*TestMessage) Reset Uses

func (m *TestMessage) Reset()

func (*TestMessage) Size Uses

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

func (TestMessage) String Uses

func (tm TestMessage) String() string

func (*TestMessage) Unmarshal Uses

func (m *TestMessage) Unmarshal(dAtA []byte) error

func (*TestMessage) XXX_DiscardUnknown Uses

func (m *TestMessage) XXX_DiscardUnknown()

func (*TestMessage) XXX_Marshal Uses

func (m *TestMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TestMessage) XXX_Merge Uses

func (m *TestMessage) XXX_Merge(src proto.Message)

func (*TestMessage) XXX_MessageName Uses

func (*TestMessage) XXX_MessageName() string

func (*TestMessage) XXX_Size Uses

func (m *TestMessage) XXX_Size() int

func (*TestMessage) XXX_Unmarshal Uses

func (m *TestMessage) XXX_Unmarshal(b []byte) error



Package encoding imports 8 packages (graph) and is imported by 20 packages. Updated 2020-05-03. Refresh now. Tools for package owners.