Documentation
¶
Overview ¶
Package amfcodec reads and writes Action Message Format, both AMF0 and AMF3.
The two formats share a package because a value is often encoded in one and referenced from the other. Both directions work on the ordered JSON model in github.com/roberson-io/cchef/internal/jsonval, so an object's keys come back out in the order they went in — which decides the bytes, and is what makes the encoding reproducible.
AMF3's reference tables mean a string, object or trait appears once and is pointed at afterwards; NewTables3 holds that state for one encoding or decoding pass.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode0 ¶
Decode0 reads one AMF0 value. refs holds the objects seen so far, which the reference marker points back into.
func Encode3 ¶
Encode3 writes one value in AMF3. Nothing is written by reference: the output is a little larger than it need be, and reads identically.
func NewTables3 ¶
func NewTables3() *amf3Tables
NewTables3 returns the reference tables one AMF3 encoding or decoding pass keeps: a value written once is pointed at by index afterwards.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads AMF from a byte slice, refusing to read past the end.