Documentation
¶
Overview ¶
Package binary implements the binary (msgpack) codec of soft.go/ecore. Importing it registers the codec for the "bin" extension in the default codec registry.
Index ¶
Constants ¶
const ( OPTION_ID_ATTRIBUTE = "ID_ATTRIBUTE" // if true, save id attribute of the object OPTION_NAMESPACE_ATTRIBUTE = "NAMESPACE_ATTIBUTE" // if true, namespaces informations are encoded OPTION_MAX_DEPTH = "MAX_DEPTH" // int, the maximum nesting of the objects a decoder reads (DefaultMaxDepth) )
const DefaultMaxDepth = 100_000
DefaultMaxDepth is the maximum nesting of the objects the decoder reads when OPTION_MAX_DEPTH is not given. An object is decoded inside the object that first refers to it, by containment or by a plain reference, so the nesting of a resource is the length of its longest chain of first references: a deeper input is refused with an error instead of growing the goroutine stack until the runtime aborts the process, which no recover can catch.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func (*Decoder) DecodeResource ¶
func (d *Decoder) DecodeResource()
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoderWithVersion ¶
func (*Encoder) EncodeResource ¶
func (e *Encoder) EncodeResource()