amf0

package
v0.0.0-...-5278192 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNumber      byte = 0x00
	TypeBoolean          = 0x01
	TypeString           = 0x02
	TypeObject           = 0x03
	TypeMovieClip        = 0x04 // reserved, not supported
	TypeNull             = 0x05
	TypeUndefined        = 0x06
	TypeReference        = 0x07
	TypeECMAArray        = 0x08
	TypeObjectEnd        = 0x09
	TypeStrictArray      = 0x0A
	TypeDate             = 0x0B
	TypeLongString       = 0x0C
	TypeUnsupported      = 0x0D
	TypeRecordSet        = 0x0E // reserved, not supported
	TypeXMLDocument      = 0x0F
	TypeTypedObject      = 0x10
)

Variables

This section is empty.

Functions

func Decode

func Decode(bytes []byte) (interface{}, error)

Decode returns the original form of the encoded value, or an error if any occurred. Possible return types: float64, bool, string, map[string]interface{}, nil, amf0.ECMAArray, time.Time If the contents of b represent a Number (either int or float), it will be returned as a float64

func Encode

func Encode(v interface{}) ([]byte, error)

func Size

func Size(v interface{}) uint64

Size returns the number of bytes the value v has in its AMF0 representation. Eg: a value v of "test" will return 7 (3 bytes for the header, 4 bytes for the string Size) Eg: a value v of 5 will return 9 (1 byte for the header, 8 bytes for the number)

Types

type ECMAArray

type ECMAArray map[string]interface{}

type ObjectEnd

type ObjectEnd struct{}

Jump to

Keyboard shortcuts

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