Documentation
¶
Index ¶
- Constants
- Variables
- func GetFloat32BE(b []byte) float32
- func GetFloat32LE(b []byte) float32
- func GetFloat64BE(b []byte) float64
- func GetFloat64LE(b []byte) float64
- func GetUint16BE(b []byte) uint16
- func GetUint16LE(b []byte) uint16
- func GetUint24BE(b []byte) uint32
- func GetUint24LE(b []byte) uint32
- func GetUint32BE(b []byte) uint32
- func GetUint32LE(b []byte) uint32
- func GetUint40BE(b []byte) uint64
- func GetUint40LE(b []byte) uint64
- func GetUint48BE(b []byte) uint64
- func GetUint48LE(b []byte) uint64
- func GetUint56BE(b []byte) uint64
- func GetUint56LE(b []byte) uint64
- func GetUint64BE(b []byte) uint64
- func GetUint64LE(b []byte) uint64
- func GetUvarint(b []byte) (uint64, int)
- func GetVarint(b []byte) (int64, int)
- func PutFloat32BE(b []byte, v float32)
- func PutFloat32LE(b []byte, v float32)
- func PutFloat64BE(b []byte, v float64)
- func PutFloat64LE(b []byte, v float64)
- func PutUint16BE(b []byte, v uint16)
- func PutUint16LE(b []byte, v uint16)
- func PutUint24BE(b []byte, v uint32)
- func PutUint24LE(b []byte, v uint32)
- func PutUint32BE(b []byte, v uint32)
- func PutUint32LE(b []byte, v uint32)
- func PutUint40BE(b []byte, v uint64)
- func PutUint40LE(b []byte, v uint64)
- func PutUint48BE(b []byte, v uint64)
- func PutUint48LE(b []byte, v uint64)
- func PutUint56BE(b []byte, v uint64)
- func PutUint56LE(b []byte, v uint64)
- func PutUint64BE(b []byte, v uint64)
- func PutUint64LE(b []byte, v uint64)
- func PutUvarint(b []byte, v uint64) int
- func PutVarint(b []byte, v int64) int
- func ReadUvarint(r io.ByteReader) (uint64, error)
- func ReadVarint(r io.ByteReader) (int64, error)
- func UvarintSize(x uint64) int
- func VarintSize(x int64) int
- type HeadSpliter
- type ProtobufProtocol
- type Reader
- func (reader *Reader) Error() error
- func (reader *Reader) Read(b []byte) (n int, err error)
- func (reader *Reader) ReadByte() (byte, error)
- func (reader *Reader) ReadBytes(n int) (b []byte)
- func (reader *Reader) ReadFloat32BE() float32
- func (reader *Reader) ReadFloat32LE() float32
- func (reader *Reader) ReadFloat64BE() float64
- func (reader *Reader) ReadFloat64LE() float64
- func (reader *Reader) ReadInt16BE() int16
- func (reader *Reader) ReadInt16LE() int16
- func (reader *Reader) ReadInt24BE() int32
- func (reader *Reader) ReadInt24LE() int32
- func (reader *Reader) ReadInt32BE() int32
- func (reader *Reader) ReadInt32LE() int32
- func (reader *Reader) ReadInt40BE() int64
- func (reader *Reader) ReadInt40LE() int64
- func (reader *Reader) ReadInt48BE() int64
- func (reader *Reader) ReadInt48LE() int64
- func (reader *Reader) ReadInt56BE() int64
- func (reader *Reader) ReadInt56LE() int64
- func (reader *Reader) ReadInt64BE() int64
- func (reader *Reader) ReadInt64LE() int64
- func (reader *Reader) ReadInt8() int8
- func (reader *Reader) ReadIntBE() int
- func (reader *Reader) ReadIntLE() int
- func (reader *Reader) ReadPacket(spliter HeadSpliter) (b []byte)
- func (reader *Reader) ReadString(n int) string
- func (reader *Reader) ReadUint16BE() uint16
- func (reader *Reader) ReadUint16LE() uint16
- func (reader *Reader) ReadUint24BE() uint32
- func (reader *Reader) ReadUint24LE() uint32
- func (reader *Reader) ReadUint32BE() uint32
- func (reader *Reader) ReadUint32LE() uint32
- func (reader *Reader) ReadUint40BE() uint64
- func (reader *Reader) ReadUint40LE() uint64
- func (reader *Reader) ReadUint48BE() uint64
- func (reader *Reader) ReadUint48LE() uint64
- func (reader *Reader) ReadUint56BE() uint64
- func (reader *Reader) ReadUint56LE() uint64
- func (reader *Reader) ReadUint64BE() uint64
- func (reader *Reader) ReadUint64LE() uint64
- func (reader *Reader) ReadUint8() (v uint8)
- func (reader *Reader) ReadUintBE() uint
- func (reader *Reader) ReadUintLE() uint
- func (reader *Reader) ReadUvarint() (v uint64)
- func (reader *Reader) ReadVarint() (v int64)
- func (reader *Reader) Reset(r io.Reader)
- type Writer
- func (writer *Writer) Error() error
- func (writer *Writer) Reset(w io.Writer)
- func (writer *Writer) Write(b []byte) (n int, err error)
- func (writer *Writer) WriteBytes(b []byte)
- func (writer *Writer) WriteFloat32BE(v float32)
- func (writer *Writer) WriteFloat32LE(v float32)
- func (writer *Writer) WriteFloat64BE(v float64)
- func (writer *Writer) WriteFloat64LE(v float64)
- func (writer *Writer) WriteInt16BE(v int16)
- func (writer *Writer) WriteInt16LE(v int16)
- func (writer *Writer) WriteInt24BE(v int32)
- func (writer *Writer) WriteInt24LE(v int32)
- func (writer *Writer) WriteInt32BE(v int32)
- func (writer *Writer) WriteInt32LE(v int32)
- func (writer *Writer) WriteInt40BE(v int64)
- func (writer *Writer) WriteInt40LE(v int64)
- func (writer *Writer) WriteInt48BE(v int64)
- func (writer *Writer) WriteInt48LE(v int64)
- func (writer *Writer) WriteInt56BE(v int64)
- func (writer *Writer) WriteInt56LE(v int64)
- func (writer *Writer) WriteInt64BE(v int64)
- func (writer *Writer) WriteInt64LE(v int64)
- func (writer *Writer) WriteInt8(v int8)
- func (writer *Writer) WriteIntBE(v int)
- func (writer *Writer) WriteIntLE(v int)
- func (writer *Writer) WritePacket(b []byte, spliter HeadSpliter)
- func (writer *Writer) WriteString(s string)
- func (writer *Writer) WriteUint16BE(v uint16)
- func (writer *Writer) WriteUint16LE(v uint16)
- func (writer *Writer) WriteUint24BE(v uint32)
- func (writer *Writer) WriteUint24LE(v uint32)
- func (writer *Writer) WriteUint32BE(v uint32)
- func (writer *Writer) WriteUint32LE(v uint32)
- func (writer *Writer) WriteUint40BE(v uint64)
- func (writer *Writer) WriteUint40LE(v uint64)
- func (writer *Writer) WriteUint48BE(v uint64)
- func (writer *Writer) WriteUint48LE(v uint64)
- func (writer *Writer) WriteUint56BE(v uint64)
- func (writer *Writer) WriteUint56LE(v uint64)
- func (writer *Writer) WriteUint64BE(v uint64)
- func (writer *Writer) WriteUint64LE(v uint64)
- func (writer *Writer) WriteUint8(v uint8)
- func (writer *Writer) WriteUintBE(v uint)
- func (writer *Writer) WriteUintLE(v uint)
- func (writer *Writer) WriteUvarint(v uint64)
- func (writer *Writer) WriteVarint(v int64)
Constants ¶
View Source
const ( MaxVarintLen16 = binary.MaxVarintLen16 MaxVarintLen32 = binary.MaxVarintLen32 MaxVarintLen64 = binary.MaxVarintLen64 )
Variables ¶
View Source
var ( SplitByUint16BE = HeadSpliter{ ReadHead: func(r *Reader) int { return int(r.ReadUint16BE()) }, WriteHead: func(w *Writer, l int) { w.WriteUint16BE(uint16(l)) }, } SplitByUint16LE = HeadSpliter{ ReadHead: func(r *Reader) int { return int(r.ReadUint16LE()) }, WriteHead: func(w *Writer, l int) { w.WriteUint16LE(uint16(l)) }, } )
Functions ¶
func GetFloat32BE ¶
func GetFloat32LE ¶
func GetFloat64BE ¶
func GetFloat64LE ¶
func GetUint16BE ¶
func GetUint16LE ¶
func GetUint24BE ¶
func GetUint24LE ¶
func GetUint32BE ¶
func GetUint32LE ¶
func GetUint40BE ¶
func GetUint40LE ¶
func GetUint48BE ¶
func GetUint48LE ¶
func GetUint56BE ¶
func GetUint56LE ¶
func GetUint64BE ¶
func GetUint64LE ¶
func GetUvarint ¶
func PutFloat32BE ¶
func PutFloat32LE ¶
func PutFloat64BE ¶
func PutFloat64LE ¶
func PutUint16BE ¶
func PutUint16LE ¶
func PutUint24BE ¶
func PutUint24LE ¶
func PutUint32BE ¶
func PutUint32LE ¶
func PutUint40BE ¶
func PutUint40LE ¶
func PutUint48BE ¶
func PutUint48LE ¶
func PutUint56BE ¶
func PutUint56LE ¶
func PutUint64BE ¶
func PutUint64LE ¶
func PutUvarint ¶
func ReadUvarint ¶
func ReadUvarint(r io.ByteReader) (uint64, error)
func ReadVarint ¶
func ReadVarint(r io.ByteReader) (int64, error)
func UvarintSize ¶
func VarintSize ¶
Types ¶
type HeadSpliter ¶
func (HeadSpliter) Limit ¶
func (s HeadSpliter) Limit(r *Reader) *io.LimitedReader
func (HeadSpliter) Read ¶
func (s HeadSpliter) Read(r *Reader) []byte
func (HeadSpliter) Write ¶
func (s HeadSpliter) Write(w *Writer, b []byte)
type ProtobufProtocol ¶
type ProtobufProtocol struct {
// contains filtered or unexported fields
}
func Protobuf ¶
func Protobuf() *ProtobufProtocol
func (*ProtobufProtocol) NewCodec ¶
func (p *ProtobufProtocol) NewCodec(rw io.ReadWriter) libnet.Codec
func (*ProtobufProtocol) Register ¶
func (j *ProtobufProtocol) Register(t interface{})
func (*ProtobufProtocol) RegisterName ¶
func (j *ProtobufProtocol) RegisterName(name string, t interface{})
type Reader ¶
func (*Reader) ReadFloat32BE ¶
func (*Reader) ReadFloat32LE ¶
func (*Reader) ReadFloat64BE ¶
func (*Reader) ReadFloat64LE ¶
func (*Reader) ReadInt16BE ¶
func (*Reader) ReadInt16LE ¶
func (*Reader) ReadInt24BE ¶
func (*Reader) ReadInt24LE ¶
func (*Reader) ReadInt32BE ¶
func (*Reader) ReadInt32LE ¶
func (*Reader) ReadInt40BE ¶
func (*Reader) ReadInt40LE ¶
func (*Reader) ReadInt48BE ¶
func (*Reader) ReadInt48LE ¶
func (*Reader) ReadInt56BE ¶
func (*Reader) ReadInt56LE ¶
func (*Reader) ReadInt64BE ¶
func (*Reader) ReadInt64LE ¶
func (*Reader) ReadPacket ¶
func (reader *Reader) ReadPacket(spliter HeadSpliter) (b []byte)
func (*Reader) ReadString ¶
func (*Reader) ReadUint16BE ¶
func (*Reader) ReadUint16LE ¶
func (*Reader) ReadUint24BE ¶
func (*Reader) ReadUint24LE ¶
func (*Reader) ReadUint32BE ¶
func (*Reader) ReadUint32LE ¶
func (*Reader) ReadUint40BE ¶
func (*Reader) ReadUint40LE ¶
func (*Reader) ReadUint48BE ¶
func (*Reader) ReadUint48LE ¶
func (*Reader) ReadUint56BE ¶
func (*Reader) ReadUint56LE ¶
func (*Reader) ReadUint64BE ¶
func (*Reader) ReadUint64LE ¶
func (*Reader) ReadUintBE ¶
func (*Reader) ReadUintLE ¶
func (*Reader) ReadUvarint ¶
func (*Reader) ReadVarint ¶
type Writer ¶
func (*Writer) WriteBytes ¶
func (*Writer) WriteFloat32BE ¶
func (*Writer) WriteFloat32LE ¶
func (*Writer) WriteFloat64BE ¶
func (*Writer) WriteFloat64LE ¶
func (*Writer) WriteInt16BE ¶
func (*Writer) WriteInt16LE ¶
func (*Writer) WriteInt24BE ¶
func (*Writer) WriteInt24LE ¶
func (*Writer) WriteInt32BE ¶
func (*Writer) WriteInt32LE ¶
func (*Writer) WriteInt40BE ¶
func (*Writer) WriteInt40LE ¶
func (*Writer) WriteInt48BE ¶
func (*Writer) WriteInt48LE ¶
func (*Writer) WriteInt56BE ¶
func (*Writer) WriteInt56LE ¶
func (*Writer) WriteInt64BE ¶
func (*Writer) WriteInt64LE ¶
func (*Writer) WriteIntBE ¶
func (*Writer) WriteIntLE ¶
func (*Writer) WritePacket ¶
func (writer *Writer) WritePacket(b []byte, spliter HeadSpliter)
func (*Writer) WriteString ¶
func (*Writer) WriteUint16BE ¶
func (*Writer) WriteUint16LE ¶
func (*Writer) WriteUint24BE ¶
func (*Writer) WriteUint24LE ¶
func (*Writer) WriteUint32BE ¶
func (*Writer) WriteUint32LE ¶
func (*Writer) WriteUint40BE ¶
func (*Writer) WriteUint40LE ¶
func (*Writer) WriteUint48BE ¶
func (*Writer) WriteUint48LE ¶
func (*Writer) WriteUint56BE ¶
func (*Writer) WriteUint56LE ¶
func (*Writer) WriteUint64BE ¶
func (*Writer) WriteUint64LE ¶
func (*Writer) WriteUint8 ¶
func (*Writer) WriteUintBE ¶
func (*Writer) WriteUintLE ¶
func (*Writer) WriteUvarint ¶
func (*Writer) WriteVarint ¶
Click to show internal directories.
Click to hide internal directories.