wipro

package module
v0.0.0-...-ae5e8f9 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-2-Clause Imports: 2 Imported by: 3

README

wipro: Wire Protocol Generator

h12.io/wipro is a Go code generator for Kafka like wire protocol over TCP. It can generate Go structs as well as their marshaling/unmarshaling methods from compatible BNF notations.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPrefix        = "proto: "
	ErrUnexpectedEOF = errors.New(ErrPrefix + "unexpected EOF")
)

Functions

func Receive

func Receive(conn io.Reader, m M) error

func Send

func Send(m M, conn io.Writer) error

Types

type M

type M interface {
	Marshal(*Writer)
	Unmarshal(*Reader)
}

type Reader

type Reader struct {
	B      []byte
	Offset int
	Err    error
}

func (*Reader) Grow

func (r *Reader) Grow(n int)

func (*Reader) ReadBytes

func (r *Reader) ReadBytes() []byte

func (*Reader) ReadInt16

func (r *Reader) ReadInt16() int16

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() int32

func (*Reader) ReadInt64

func (r *Reader) ReadInt64() int64

func (*Reader) ReadInt8

func (r *Reader) ReadInt8() int8

func (*Reader) ReadString

func (r *Reader) ReadString() string

func (*Reader) ReadUint32

func (r *Reader) ReadUint32() uint32

func (*Reader) Reset

func (r *Reader) Reset()

type Writer

type Writer struct {
	B []byte
}

func (*Writer) SetInt32

func (w *Writer) SetInt32(offset int, i int32)

func (*Writer) SetUint32

func (w *Writer) SetUint32(offset int, i uint32)

func (*Writer) WriteBytes

func (w *Writer) WriteBytes(bs []byte)

func (*Writer) WriteInt16

func (w *Writer) WriteInt16(i int16)

func (*Writer) WriteInt32

func (w *Writer) WriteInt32(i int32)

func (*Writer) WriteInt64

func (w *Writer) WriteInt64(i int64)

func (*Writer) WriteInt8

func (w *Writer) WriteInt8(i int8)

func (*Writer) WriteString

func (w *Writer) WriteString(s string)

func (*Writer) WriteUint32

func (w *Writer) WriteUint32(i uint32)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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