types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FixMap   = 0x80
	FixArray = 0x90
	FixStr   = 0xA0

	NilCode = 0xC0
	False   = 0xC2
	True    = 0xC3

	Bin8  = 0xC4
	Bin16 = 0xC5
	Bin32 = 0xC6

	Ext8  = 0xC7
	Ext16 = 0xC8
	Ext32 = 0xC9

	Float32 = 0xCA
	Float64 = 0xCB

	Uint8  = 0xCC
	Uint16 = 0xCD
	Uint32 = 0xCE
	Uint64 = 0xCF

	Int8  = 0xD0
	Int16 = 0xD1
	Int32 = 0xD2
	Int64 = 0xD3

	FixExt1  = 0xD4
	FixExt2  = 0xD5
	FixExt4  = 0xD6
	FixExt8  = 0xD7
	FixExt16 = 0xD8

	Str8  = 0xD9
	Str16 = 0xDA
	Str32 = 0xDB

	Array16 = 0xDC
	Array32 = 0xDD

	Map16 = 0xDE
	Map32 = 0xDF
)

MessagePack types

View Source
const (
	NegativeFixIntMin = -32
	Max5Bit           = 0b00011111
)

General constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array []utils.MessagePackType

Go types

func (Array) Len

func (a Array) Len() int

Len returns the length of the MessagePack encoded array. It is 0 if the data inside is invalid.

func (Array) WriteTo

func (a Array) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the array value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Binary

type Binary []byte

Go types

func (Binary) Len

func (b Binary) Len() int

Len returns the length of the MessagePack encoded string. It is 0 if the data inside is invalid.

func (Binary) WriteTo

func (b Binary) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the binary value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Boolean

type Boolean bool

Go types

func (Boolean) Len

func (b Boolean) Len() int

Len returns the length of the MessagePack encoded boolean.

func (Boolean) WriteTo

func (b Boolean) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the boolean value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type External

type External struct {
	Type byte
	Data []byte
}

External MessagePack type

func (External) Len

func (e External) Len() int

Len returns the length of the MessagePack encoded external type. It is 0 if the data inside is invalid.

func (External) WriteTo

func (e External) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the external value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Float

type Float float64

Go types

func (Float) Len

func (f Float) Len() int

Len returns the length of the MessagePack encoded float.

func (Float) WriteTo

func (f Float) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the floating point value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Int

type Int int64

Go types

func (Int) Len

func (i Int) Len() int

Len returns the length of the MessagePack encoded integer.

func (Int) WriteTo

func (i Int) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the integer value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Map

type Map []MessagePackMap

Go types

func (Map) Len

func (m Map) Len() int

Len returns the length of the MessagePack encoded map. It is 0 if the data inside is invalid.

func (Map) WriteTo

func (m Map) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the map value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type MessagePackMap

type MessagePackMap struct {
	Key   utils.MessagePackType
	Value utils.MessagePackType
}

MessagePackMap is a single Key-Value association

type Nil

type Nil struct{}

Go types

func (Nil) Len

func (n Nil) Len() int

Len returns the length of the MessagePack encoded null.

func (Nil) WriteTo

func (n Nil) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the null value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type String

type String string

Go types

func (String) Len

func (s String) Len() int

Len returns the length of the MessagePack encoded string. It is 0 if the data inside is invalid.

func (String) WriteTo

func (s String) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the string value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

type Struct

type Struct reflect.Value

Go types

type Uint

type Uint uint64

Go types

func (Uint) Len

func (u Uint) Len() int

Len returns the length of the MessagePack encoded unsigned integer.

func (Uint) WriteTo

func (u Uint) WriteTo(w io.Writer) (int64, error)

WriteTo writes the encoding of the unsigned integer value to io.Writer. It implements io.WriterTo interface. It returns the number of written bytes and an optional error.

Jump to

Keyboard shortcuts

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