tmencoding

package
Version: v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TMEncoder

type TMEncoder interface {
	EncodeBool(b bool) []byte
	EncodeFloat32(f float32) []byte
	EncodeFloat64(f float64) []byte
	EncodeInt8(i int8) []byte
	EncodeInt16(i int16) []byte
	EncodeInt32(i int32) []byte
	EncodeInt64(i int64) []byte
	EncodeOctet(b byte) []byte
	EncodeOctets(b []byte) []byte
	EncodeTime(t time.Time) []byte
	EncodeUint8(i uint8) []byte
	EncodeUint16(i uint16) []byte
	EncodeUint16s(iz []uint16) []byte
	EncodeUint32(i uint32) []byte
	EncodeUint64(i uint64) []byte
	EncodeUvarint(i uint) []byte
	EncodeVarint(i int) []byte
}

Simplest pure interface for encoding and generally preferred.

type TMEncoderBuilder

type TMEncoderBuilder interface {
	Bytes() []byte
	EncodeBool(b bool) TMEncoderBuilder
	EncodeFloat32(f float32) TMEncoderBuilder
	EncodeFloat64(f float64) TMEncoderBuilder
	EncodeInt8(i int8) TMEncoderBuilder
	EncodeInt16(i int16) TMEncoderBuilder
	EncodeInt32(i int32) TMEncoderBuilder
	EncodeInt64(i int64) TMEncoderBuilder
	EncodeOctet(b byte) TMEncoderBuilder
	EncodeOctets(b []byte) TMEncoderBuilder
	EncodeTime(t time.Time) TMEncoderBuilder
	EncodeUint8(i uint8) TMEncoderBuilder
	EncodeUint16s(iz []uint16) TMEncoderBuilder
	EncodeUint32(i uint32) TMEncoderBuilder
	EncodeUint64(i uint64) TMEncoderBuilder
	EncodeUvarint(i uint) TMEncoderBuilder
	EncodeVarint(i int) TMEncoderBuilder
}

Allow chaining builder pattern syntactic sugar variation of Facade teb.EncodeInt8(42).EncodeInt32(my_integer).Bytes()

type TMEncoderChain

type TMEncoderChain struct {
	// contains filtered or unexported fields
}

wrap a BytesOut encoder with a standard stateful bytes.Buffer to provide the TMEncoderBuilder

func NewTMEncoderChain

func NewTMEncoderChain(pure TMEncoderPure) *TMEncoderChain

func (*TMEncoderChain) Bytes

func (a *TMEncoderChain) Bytes() []byte

func (*TMEncoderChain) EncodeBool

func (a *TMEncoderChain) EncodeBool(b bool) TMEncoderBuilder

func (*TMEncoderChain) EncodeFloat32

func (a *TMEncoderChain) EncodeFloat32(f float32) TMEncoderBuilder

func (*TMEncoderChain) EncodeFloat64

func (a *TMEncoderChain) EncodeFloat64(f float64) TMEncoderBuilder

func (*TMEncoderChain) EncodeInt16

func (a *TMEncoderChain) EncodeInt16(i int16) TMEncoderBuilder

func (*TMEncoderChain) EncodeInt32

func (a *TMEncoderChain) EncodeInt32(i int32) TMEncoderBuilder

func (*TMEncoderChain) EncodeInt64

func (a *TMEncoderChain) EncodeInt64(i int64) TMEncoderBuilder

func (*TMEncoderChain) EncodeInt8

func (a *TMEncoderChain) EncodeInt8(i int8) TMEncoderBuilder

func (*TMEncoderChain) EncodeOctet

func (a *TMEncoderChain) EncodeOctet(b byte) TMEncoderBuilder

func (*TMEncoderChain) EncodeOctets

func (a *TMEncoderChain) EncodeOctets(b []byte) TMEncoderBuilder

func (*TMEncoderChain) EncodeTime

func (a *TMEncoderChain) EncodeTime(t time.Time) TMEncoderBuilder

func (*TMEncoderChain) EncodeUint16s

func (a *TMEncoderChain) EncodeUint16s(iz []uint16) TMEncoderBuilder

func (*TMEncoderChain) EncodeUint32

func (a *TMEncoderChain) EncodeUint32(i uint32) TMEncoderBuilder

func (*TMEncoderChain) EncodeUint64

func (a *TMEncoderChain) EncodeUint64(i uint64) TMEncoderBuilder

func (*TMEncoderChain) EncodeUint8

func (a *TMEncoderChain) EncodeUint8(i uint8) TMEncoderBuilder

func (*TMEncoderChain) EncodeUvarint

func (a *TMEncoderChain) EncodeUvarint(i uint) TMEncoderBuilder

func (*TMEncoderChain) EncodeVarint

func (a *TMEncoderChain) EncodeVarint(i int) TMEncoderBuilder

type TMEncoderFastIOWriter

type TMEncoderFastIOWriter interface {
	WriteBool(b bool, w io.Writer, n *int, err *error)
	WriteFloat32(f float32, w io.Writer, n *int, err *error)
	WriteFloat64(f float64, w io.Writer, n *int, err *error)
	WriteInt8(i int8, w io.Writer, n *int, err *error)
	WriteInt16(i int16, w io.Writer, n *int, err *error)
	WriteInt32(i int32, w io.Writer, n *int, err *error)
	WriteInt64(i int64, w io.Writer, n *int, err *error)
	WriteOctet(b byte, w io.Writer, n *int, err *error)
	WriteOctetSlice(bz []byte, w io.Writer, n *int, err *error)
	WriteTime(t time.Time, w io.Writer, n *int, err *error)
	WriteTo(bz []byte, w io.Writer, n *int, err *error)
	WriteUint8(i uint8, w io.Writer, n *int, err *error)
	WriteUint16(i uint16, w io.Writer, n *int, err *error)
	WriteUint16s(iz []uint16, w io.Writer, n *int, err *error)
	WriteUint32(i uint32, w io.Writer, n *int, err *error)
	WriteUint64(i uint64, w io.Writer, n *int, err *error)
	WriteUvarint(i uint, w io.Writer, n *int, err *error)
	WriteVarint(i int, w io.Writer, n *int, err *error)
}

Legacy interface following old code as closely as possible. Changed `WriteBytes` to `WriteOctets` to solve `go vet` issue. The explicit declaration of this interface provides a verbal discussion tool as well as a code marking work and it allows us to migrate away from using the global namespace for the Write* methods in the old 'wire.go' as we refactor. This class may disappear once the refactoring is complete.

type TMEncoderPure

type TMEncoderPure struct {
}

Implementation of the TMEncoder interface.

func (TMEncoderPure) EncodeBool

func (e TMEncoderPure) EncodeBool(b bool) []byte

func (TMEncoderPure) EncodeFloat32

func (e TMEncoderPure) EncodeFloat32(f float32) []byte

func (TMEncoderPure) EncodeFloat64

func (e TMEncoderPure) EncodeFloat64(f float64) []byte

func (TMEncoderPure) EncodeInt16

func (e TMEncoderPure) EncodeInt16(i int16) []byte

func (TMEncoderPure) EncodeInt32

func (e TMEncoderPure) EncodeInt32(i int32) []byte

func (TMEncoderPure) EncodeInt64

func (e TMEncoderPure) EncodeInt64(i int64) []byte

func (TMEncoderPure) EncodeInt8

func (e TMEncoderPure) EncodeInt8(i int8) []byte

func (TMEncoderPure) EncodeOctet

func (e TMEncoderPure) EncodeOctet(b byte) []byte

func (TMEncoderPure) EncodeOctets

func (e TMEncoderPure) EncodeOctets(b []byte) []byte

for orthogonality only

func (TMEncoderPure) EncodeTime

func (e TMEncoderPure) EncodeTime(t time.Time) []byte

func (TMEncoderPure) EncodeUint16

func (e TMEncoderPure) EncodeUint16(i uint16) []byte

func (TMEncoderPure) EncodeUint16s

func (e TMEncoderPure) EncodeUint16s(iz []uint16) []byte

func (TMEncoderPure) EncodeUint32

func (e TMEncoderPure) EncodeUint32(i uint32) []byte

func (TMEncoderPure) EncodeUint64

func (e TMEncoderPure) EncodeUint64(i uint64) []byte

func (TMEncoderPure) EncodeUint8

func (e TMEncoderPure) EncodeUint8(i uint8) []byte

func (TMEncoderPure) EncodeUvarint

func (e TMEncoderPure) EncodeUvarint(i uint) []byte

func (TMEncoderPure) EncodeVarint

func (e TMEncoderPure) EncodeVarint(i int) []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL