v3

package
v0.0.0-...-e148948 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMPLEX_TABLE = iota
	STRING_TABLE
	TRAIT_TABLE
)
View Source
const (
	HIGH_BIT_MASK = 0x80
	LOW_BITS_MASK = 0x7f
)
View Source
const (
	AMF_UNDEFINED     = 0x00
	AMF_NULL          = 0x01
	AMF_FALSE         = 0x02
	AMF_TRUE          = 0x03
	AMF_INTEGER       = 0x04
	AMF_DOUBLE        = 0x05
	AMF_STRING        = 0x06
	AMF_XML_DOC       = 0x07
	AMF_DATE          = 0x08
	AMF_ARRAY         = 0x09
	AMF_OBJECT        = 0x0a
	AMF_XML           = 0x0b
	AMF_BYTE_ARRAY    = 0x0c
	AMF_VECTOR_INT    = 0x0d
	AMF_VECTOR_UINT   = 0x0e
	AMF_VECTOR_DOUBLE = 0x0f
	AMF_VECTOR_OBJECT = 0x10
	AMF_DICTIONARY    = 0x11
)
View Source
const (
	AMF_STRING_HEADER_MAXLEN = 0xf0 << 24
)

Variables

This section is empty.

Functions

func AmfBool

func AmfBool(value bool) []byte

func AmfDoubleDecode

func AmfDoubleDecode(data []byte) (float64, int, error)

func AmfDoubleDecodePayload

func AmfDoubleDecodePayload(data []byte) (float64, int, error)

func AmfDoubleEncode

func AmfDoubleEncode(value float64) ([]byte, error)

func AmfDoubleEncodePayload

func AmfDoubleEncodePayload(value float64) ([]byte, error)

func AmfIntDecode

func AmfIntDecode(bytes []byte) (uint32, int, error)

func AmfIntDecodePayload

func AmfIntDecodePayload(bytes []byte) (uint32, int, error)

func AmfIntEncode

func AmfIntEncode(value uint32) ([]byte, error)

func AmfIntEncodePayload

func AmfIntEncodePayload(value uint32) ([]byte, error)

func AmfNull

func AmfNull() []byte

func AmfStringHeader

func AmfStringHeader(len uint32) ([]byte, error)

func AmfStringRef

func AmfStringRef(id uint32) ([]byte, error)

func AmfUndefined

func AmfUndefined() []byte

Types

type AmfArrAssoc

type AmfArrAssoc struct {
	Key   string
	Value interface{}
}

type AmfArray

type AmfArray struct {
	Dense []interface{}
	Assoc []AmfArrAssoc
}

func EmptyAmfArray

func EmptyAmfArray() *AmfArray

func (*AmfArray) AddAssoc

func (arr *AmfArray) AddAssoc(key string, value interface{})

func (*AmfArray) AddDense

func (arr *AmfArray) AddDense(value interface{})

type AmfCodec

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

func NewAmfCodec

func NewAmfCodec() *AmfCodec

func (*AmfCodec) AmfArrayDecode

func (codec *AmfCodec) AmfArrayDecode(data []byte) (*AmfArray, int, error)

func (*AmfCodec) AmfArrayEncode

func (codec *AmfCodec) AmfArrayEncode(arr *AmfArray) ([]byte, error)

func (*AmfCodec) AmfByteArrayDecode

func (codec *AmfCodec) AmfByteArrayDecode(data []byte) ([]byte, int, error)

func (*AmfCodec) AmfByteArrayEncode

func (codec *AmfCodec) AmfByteArrayEncode(value *[]byte) ([]byte, error)

func (*AmfCodec) AmfDateDecode

func (codec *AmfCodec) AmfDateDecode(data []byte) (AmfDate, int, error)

func (*AmfCodec) AmfDateEncode

func (codec *AmfCodec) AmfDateEncode(value AmfDate) ([]byte, error)

func (*AmfCodec) AmfDateNow

func (codec *AmfCodec) AmfDateNow() ([]byte, error)

func (*AmfCodec) AmfDecode

func (codec *AmfCodec) AmfDecode(data []byte) (interface{}, int, error)

func (*AmfCodec) AmfDictDecode

func (codec *AmfCodec) AmfDictDecode(data []byte) (*AmfDict, int, error)

func (*AmfCodec) AmfDictEncode

func (codec *AmfCodec) AmfDictEncode(dict *AmfDict) ([]byte, error)

func (*AmfCodec) AmfEncode

func (codec *AmfCodec) AmfEncode(value interface{}) ([]byte, error)

func (*AmfCodec) AmfObjDecode

func (codec *AmfCodec) AmfObjDecode(data []byte) (*AmfObj, int, error)

func (*AmfCodec) AmfObjEncode

func (codec *AmfCodec) AmfObjEncode(obj *AmfObj) ([]byte, error)

func (*AmfCodec) AmfStringDecode

func (codec *AmfCodec) AmfStringDecode(data []byte) (string, int, error)

func (*AmfCodec) AmfStringDecodePayload

func (codec *AmfCodec) AmfStringDecodePayload(bytes []byte) (string, int, error)

func (*AmfCodec) AmfStringEncode

func (codec *AmfCodec) AmfStringEncode(value string) ([]byte, error)

func (*AmfCodec) AmfStringEncodePayload

func (codec *AmfCodec) AmfStringEncodePayload(value string) ([]byte, error)

func (*AmfCodec) AmfVectorDoubleDecode

func (codec *AmfCodec) AmfVectorDoubleDecode(data []byte) (*AmfVectorDouble, int, error)

func (*AmfCodec) AmfVectorDoubleEncode

func (codec *AmfCodec) AmfVectorDoubleEncode(vec *AmfVectorDouble) ([]byte, error)

func (*AmfCodec) AmfVectorIntDecode

func (codec *AmfCodec) AmfVectorIntDecode(data []byte) (*AmfVectorInt, int, error)

func (*AmfCodec) AmfVectorIntEncode

func (codec *AmfCodec) AmfVectorIntEncode(vec *AmfVectorInt) ([]byte, error)

func (*AmfCodec) AmfVectorObjDecode

func (codec *AmfCodec) AmfVectorObjDecode(data []byte) (*AmfVectorObj, int, error)

func (*AmfCodec) AmfVectorObjEncode

func (codec *AmfCodec) AmfVectorObjEncode(
	obj *AmfVectorObj,
) ([]byte, error)

func (*AmfCodec) AmfVectorUintDecode

func (codec *AmfCodec) AmfVectorUintDecode(data []byte) (*AmfVectorUint, int, error)

func (*AmfCodec) AmfVectorUintEncode

func (codec *AmfCodec) AmfVectorUintEncode(vec *AmfVectorUint) ([]byte, error)

func (*AmfCodec) AmfXmlDecode

func (codec *AmfCodec) AmfXmlDecode(data []byte) (AmfXml, int, error)

func (*AmfCodec) AmfXmlDocDecode

func (codec *AmfCodec) AmfXmlDocDecode(data []byte) (AmfXmlDoc, int, error)

func (*AmfCodec) AmfXmlDocEncode

func (codec *AmfCodec) AmfXmlDocEncode(value AmfXmlDoc) ([]byte, error)

func (*AmfCodec) AmfXmlEncode

func (codec *AmfCodec) AmfXmlEncode(value AmfXml) ([]byte, error)

func (*AmfCodec) Append

func (codec *AmfCodec) Append(value interface{}, kind AmfCodecTable) bool

func (*AmfCodec) Get

func (codec *AmfCodec) Get(id uint32, kind AmfCodecTable) (interface{}, bool)

func (*AmfCodec) GetId

func (codec *AmfCodec) GetId(value interface{}, kind AmfCodecTable) (uint32, bool)

type AmfCodecTable

type AmfCodecTable int

type AmfDate

type AmfDate float64

type AmfDict

type AmfDict struct {
	WeakKeys   bool
	EntryKey   []interface{}
	EntryValue []interface{}
}

func EmptyAmfDict

func EmptyAmfDict() *AmfDict

type AmfInt

type AmfInt uint32

type AmfMarker

type AmfMarker uint8

type AmfObj

type AmfObj struct {
	ClassName  string
	Member     []AmfObjMember
	DynMembers []AmfObjMember
	ExtTraits  []byte
}

func EmptyAmfObj

func EmptyAmfObj() *AmfObj

func (*AmfObj) AppendDynMember

func (obj *AmfObj) AppendDynMember(mem AmfObjMember)

func (*AmfObj) AppendMember

func (obj *AmfObj) AppendMember(mem AmfObjMember)

type AmfObjMember

type AmfObjMember struct {
	Key   string
	Value interface{}
}

type AmfTraitExtHandler

type AmfTraitExtHandler func(codec *AmfCodec, data []byte) ([]byte, int, error)

used when decoding traits-ext given data without obj marker, U29o header, class-name, return traits-ext(U8s)

type AmfTraitSet

type AmfTraitSet struct {
	ClassName        string
	Traits           []string
	IsDynamic        bool
	IsExternalizable bool
}

func NewAmfTraitSet

func NewAmfTraitSet() *AmfTraitSet

func (*AmfTraitSet) Hash

func (ts *AmfTraitSet) Hash() string

TODO: Increase efficiency

type AmfVectorDouble

type AmfVectorDouble struct {
	FixedLen bool
	Data     []float64
}

type AmfVectorInt

type AmfVectorInt struct {
	FixedLen bool
	Data     []int32
}

type AmfVectorObj

type AmfVectorObj struct {
	TypeName string
	FixedLen bool
	Data     []interface{}
}

func EmptyAmfVectorObj

func EmptyAmfVectorObj() *AmfVectorObj

type AmfVectorUint

type AmfVectorUint struct {
	FixedLen bool
	Data     []uint32
}

type AmfXml

type AmfXml string

type AmfXmlDoc

type AmfXmlDoc string

Jump to

Keyboard shortcuts

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