Documentation
¶
Overview ¶
Package buswire is the bus envelope's table wire, generated by the schema compiler from schemas/bus/envelope.schema: the Envelope (one nova-bus message), its Kind enum and its Name element. Every other .go file here is generated: edit the .schema and run go generate ./pkg/buswire, never the output. pkg/schemaread reads it strictly: binary wire, padded standard base64 of the wire, or JSON text, each refused by name when damaged.
Index ¶
- Constants
- Variables
- func Announce(buffer []byte) int64
- func AnnounceMeasure() int64
- func AnnounceRead(v *TableVocabulary, data []byte, report *TableReport) bool
- func EnumNameKind(value Kind) string
- func EnvelopeCookFrom(value *Envelope, buffer []byte, order TableByteOrder, ...) bool
- func EnvelopeCookMeasure(value *Envelope, context ...TableWriteContext) int64
- func EnvelopeCookMeasureReason(value *Envelope, context ...TableWriteContext) (int64, error)
- func EnvelopeFromJson(builder *EnvelopeBuilder, text []byte, report *TableReport) bool
- func EnvelopeLoadBody(r *TableReader, value *Envelope) bool
- func EnvelopeLoadBodyRetain(r *TableRetainReader, value *Envelope) bool
- func EnvelopeLoadBuilder(b *EnvelopeBuilder, wire []byte, report *TableReport) bool
- func EnvelopeLoadMeasure(wire []byte) int64
- func EnvelopeLoadMeasureReason(wire []byte) (int64, error)
- func EnvelopeLoadMessageBody(r *TableMessageReader, value *Envelope) bool
- func EnvelopeLoadMessageBodyRetain(r *TableRetainMessageReader, value *Envelope) bool
- func EnvelopeMeasure(value *Envelope, context ...TableWriteContext) int64
- func EnvelopeMeasureBody(value *Envelope, ids *TableIds) int64
- func EnvelopeMeasureBodyRetain(value *Envelope, ids *TableRetainIds) int64
- func EnvelopeMeasureReason(value *Envelope, context ...TableWriteContext) (int64, error)
- func EnvelopeMeasureRetain(value *Envelope, retain *TableRetain, allocator ...TableAllocator) int64
- func EnvelopeOpen(cook *EnvelopeCook, base unsafe.Pointer, length int64) bool
- func EnvelopeReset(value *Envelope)
- func EnvelopeSave(value *Envelope, buffer []byte, context ...TableWriteContext) int64
- func EnvelopeSaveBody(w *TableWriter, value *Envelope) bool
- func EnvelopeSaveBodyFields(w *TableWriter, value *Envelope) bool
- func EnvelopeSaveBodyFieldsRetain(w *TableRetainWriter, value *Envelope) bool
- func EnvelopeSaveBodyRetain(w *TableRetainWriter, value *Envelope) bool
- func EnvelopeSaveMessageBody(w *TableMessageWriter, value *Envelope) bool
- func EnvelopeSaveRetain(value *Envelope, retain *TableRetain, buffer []byte, report *TableReport, ...) int64
- func EnvelopeSaveText(value *Envelope, context ...TableWriteContext) (string, error)
- func EnvelopeToJson(value *Envelope, buffer []byte, allocator ...TableAllocator) int64
- func EnvelopeToJsonMeasure(value *Envelope, allocator ...TableAllocator) int64
- func NameCookFrom(value *Name, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
- func NameCookMeasure(value *Name, context ...TableWriteContext) int64
- func NameCookMeasureReason(value *Name, context ...TableWriteContext) (int64, error)
- func NameFromJson(builder *NameBuilder, text []byte, report *TableReport) bool
- func NameLoadBody(r *TableReader, value *Name) bool
- func NameLoadBodyRetain(r *TableRetainReader, value *Name) bool
- func NameLoadBuilder(b *NameBuilder, wire []byte, report *TableReport) bool
- func NameLoadMeasure(wire []byte) int64
- func NameLoadMeasureReason(wire []byte) (int64, error)
- func NameLoadMessageBody(r *TableMessageReader, value *Name) bool
- func NameLoadMessageBodyRetain(r *TableRetainMessageReader, value *Name) bool
- func NameMeasure(value *Name, context ...TableWriteContext) int64
- func NameMeasureBody(value *Name, ids *TableIds) int64
- func NameMeasureBodyRetain(value *Name, ids *TableRetainIds) int64
- func NameMeasureReason(value *Name, context ...TableWriteContext) (int64, error)
- func NameMeasureRetain(value *Name, retain *TableRetain, allocator ...TableAllocator) int64
- func NameOpen(cook *NameCook, base unsafe.Pointer, length int64) bool
- func NameReset(value *Name)
- func NameSave(value *Name, buffer []byte, context ...TableWriteContext) int64
- func NameSaveBody(w *TableWriter, value *Name) bool
- func NameSaveBodyFields(w *TableWriter, value *Name) bool
- func NameSaveBodyFieldsRetain(w *TableRetainWriter, value *Name) bool
- func NameSaveBodyRetain(w *TableRetainWriter, value *Name) bool
- func NameSaveMessageBody(w *TableMessageWriter, value *Name) bool
- func NameSaveRetain(value *Name, retain *TableRetain, buffer []byte, report *TableReport, ...) int64
- func NameSaveText(value *Name, context ...TableWriteContext) (string, error)
- func NameToJson(value *Name, buffer []byte, allocator ...TableAllocator) int64
- func NameToJsonMeasure(value *Name, allocator ...TableAllocator) int64
- func TableBytesEmplace(worker *TableWorker, slot *TableRef, length int64) []byte
- func TableStringEmplace(worker *TableWorker, slot *TableRef, text []byte) []byte
- type Envelope
- type EnvelopeBuilder
- func (b *EnvelopeBuilder) AsConst() *Envelope
- func (b *EnvelopeBuilder) GetRoot() *Envelope
- func (b *EnvelopeBuilder) Init(allocator ...TableAllocator) bool
- func (b *EnvelopeBuilder) Lock() bool
- func (b *EnvelopeBuilder) PackMeasure() int64
- func (b *EnvelopeBuilder) PackMeasureReason() (int64, error)
- func (b *EnvelopeBuilder) Region() []byte
- func (b *EnvelopeBuilder) Shutdown()
- type EnvelopeCook
- type EnvelopeRow
- type Kind
- type Name
- type NameBuilder
- func (b *NameBuilder) AsConst() *Name
- func (b *NameBuilder) GetRoot() *Name
- func (b *NameBuilder) Init(allocator ...TableAllocator) bool
- func (b *NameBuilder) Lock() bool
- func (b *NameBuilder) PackMeasure() int64
- func (b *NameBuilder) PackMeasureReason() (int64, error)
- func (b *NameBuilder) Region() []byte
- func (b *NameBuilder) Shutdown()
- type NameCook
- type NameRow
- type TableAllocator
- type TableArena
- type TableBitReader
- type TableBitWriter
- type TableBlob
- type TableBuildVersionMismatch
- type TableByteOrder
- type TableBytesView
- type TableCookFieldInfo
- type TableCookInfo
- type TableCookStorage
- type TableFieldInfo
- type TableFixedDst
- type TableFixedEntry
- type TableFixedGuardLink
- type TableFixedKnownLayout
- type TableIds
- type TableMessageEntry
- type TableMessageReader
- type TableMessageShape
- type TableMessageWriter
- type TableMissingRequired
- type TableNodeDirEntry
- type TableNodeMap
- type TableNumbering
- type TableOpenVerdict
- type TableReader
- func (r *TableReader) Body() (TableReader, bool)
- func (r TableReader) EndsEarly() bool
- func (r *TableReader) Get8() uint8
- func (r *TableReader) Get16() uint16
- func (r *TableReader) Get32() uint32
- func (r *TableReader) Get64() uint64
- func (r *TableReader) Has(n int64) bool
- func (r *TableReader) Leb() (uint64, bool)
- func (r *TableReader) Resolve(ref uint64) (uint64, bool)
- func (r *TableReader) Room(n uint64) bool
- func (r *TableReader) Signed(kind uint8) int64
- func (r *TableReader) Skip(kind uint8) bool
- func (r *TableReader) Sub(n int64) TableReader
- func (r *TableReader) Unsigned(kind uint8) uint64
- type TableRef
- type TableRefuseReason
- type TableReport
- type TableRetain
- type TableRetainId
- type TableRetainIds
- type TableRetainMessageReader
- type TableRetainReader
- type TableRetainWriter
- func (w *TableRetainWriter) Advance(n int64) bool
- func (w *TableRetainWriter) Header(ref uint64, kind uint8)
- func (w *TableRetainWriter) Id(id uint64)
- func (w *TableRetainWriter) IdAt(ordinal int, id uint64)
- func (w *TableRetainWriter) Put8(v uint8)
- func (w *TableRetainWriter) Put16(v uint16)
- func (w *TableRetainWriter) Put32(v uint32)
- func (w *TableRetainWriter) Put64(v uint64)
- func (w *TableRetainWriter) Put128(lo, hi uint64)
- func (w *TableRetainWriter) PutLeb(v uint64)
- func (w *TableRetainWriter) Raw(data []byte)
- func (w *TableRetainWriter) Trailer()
- type TableStringView
- type TableTimestampError
- type TableTypeInfo
- type TableUnionArmInfo
- type TableUnionInfo
- type TableVocabulary
- type TableWorker
- type TableWriteContext
- type TableWriter
- func (w *TableWriter) Advance(n int64) bool
- func (w *TableWriter) Header(ref uint64, kind uint8)
- func (w *TableWriter) Id(id uint64)
- func (w *TableWriter) IdAt(ordinal int, id uint64)
- func (w *TableWriter) Put8(v uint8)
- func (w *TableWriter) Put16(v uint16)
- func (w *TableWriter) Put32(v uint32)
- func (w *TableWriter) Put64(v uint64)
- func (w *TableWriter) Put128(lo, hi uint64)
- func (w *TableWriter) PutLeb(v uint64)
- func (w *TableWriter) Raw(data []byte)
- func (w *TableWriter) Trailer()
- type UnitViewInfo
- type ViewConstant
- type ViewType
- type ViewVariant
- type ViewVocabulary
Constants ¶
const ( TableFixedReasonPreviousForm = "previous_form" TableFixedReasonMessageFormAsFile = "message_form_as_file" TableFixedReasonNewerForm = "newer_form" TableFixedReasonLayoutMalformed = "layout_malformed" TableFixedReasonLayoutUnknown = "layout_unknown" TableFixedReasonLayoutNewer = "layout_newer" TableFixedReasonLayoutUnsupported = "layout_unsupported" TableFixedReasonLayoutRecordTooLarge = "layout_record_too_large" TableFixedReasonPlanTooLarge = "plan_too_large" TableFixedReasonBatchTooLarge = "batch_too_large" TableFixedReasonNoLayout = "no_layout" TableFixedReasonTextIllFormed = "text_ill_formed" TableFixedReasonTruncated = "truncated" TableFixedReasonReservedNotZero = "reserved_not_zero" )
THE FIXED LOAD'S REFUSAL NAMES — EXPORTED (mas-bandwidth/schema docs/FIXED-FORM-ALGORITHM.md §5.3, mas-bandwidth/schema docs/SPEC-TABLES.md §3.4). Every refusal of the fixed load has a name, the framing-damage returns included, so an adopter's existing report.Reason == "layout_newer" comparisons keep compiling against these constants; the emitted <T>FixedLoad names every reason constant in place of a string literal.
TableFixedReasonLayoutUnknown is the Reason of a file whose header hash no entry of this build's lineage holds (mas-bandwidth/schema docs/SPEC-TABLES.md §21.3, algorithm §5.3 step 5). It says what the reader knows and not which way the file lies: a newer writer's layout, an older one nobody locked and a damaged hash byte read the same.
TableFixedReasonLayoutNewer ("ship the reader") is RESERVED (SPEC-TABLES §21.3) for a hash the lock lineage proves newer, which nothing on the wire or in the lock does today, so no Go fixed load answers it; it stays exported so an adopter's existing comparisons keep compiling.
const BuildVersion uint64 = 0xbdc7a428538c4562
BuildVersion is the unit's build version (mas-bandwidth/schema docs/SPEC-TABLES.md §20): the one digest a block carries and BlockOpen compares, and the fact §3.3's announcement carries before the first body so a peer's build is knowable.
const EnvelopeLoadRetainBuilder = "Envelope: retention requires a region round trip through the VARIABLE form"
const EnvelopeSaveRetainMessages = "Envelope: retention requires a region round trip through the VARIABLE form"
const NameLoadRetainBuilder = "Name: retention requires a region round trip through the VARIABLE form"
const NameSaveRetainMessages = "Name: retention requires a region round trip through the VARIABLE form"
const ProtocolId uint64 = 0x57cd1ee385a844eb
The unit's protocol id — the hash of its wire shape (SPEC §3.1). Two sides at the same id speak identical bits; there is no other versioning.
const TableCookHeaderBytes int64 = 64
TableCookHeaderBytes is §7.1's header: 64 bytes of u64 words. The DATA part begins at align_up(64, alignment) — DERIVED and not a header field, because a fact a reader computes is a fact two writers cannot disagree about.
const TableCookMagic uint64 = 0x4b4f4f434d484353
TableCookMagic is the cook's magic (mas-bandwidth/schema docs/SPEC-TABLES.md §7.1), read before anything else: it is what establishes the byte order every other header word is written in, and it is also what separates a COOK from a BLOCK — the two accelerators carry the same build version and different magics, because a form's identity belongs in its magic rather than in a second digest.
The value is "SCHMCOOK" read as ASCII in the byte order a little-endian store produces, so a hex dump of a little-endian cook is legible.
const TableCookMaxAlign int64 = 64
TableCookMaxAlign is the ceiling on the header's alignment word: the same sixty-four a block's base takes (§19.1), past which the derived data offset would no longer be the 64 every unit this language can declare produces.
const TableDocNone = ""
THE SHARED EMPTY DOC (mas-bandwidth/schema docs/SPEC-TABLES.md §8.1): a declaration with no /// block carries a doc column naming this one definition, so absence costs a unit no string data and a printer concatenates doc columns with no nil test. Go gives a string no address identity, so what the rule is READ OFF here is the emitted text: the generated file defines the empty doc once and every unannotated row names that definition, rather than each row carrying an inline "" of its own.
const TableFixedForm uint8 = 3
const TableFixedHashAt = 8
const TableFixedHeaderBytes = 16
const TableMessageBatchMax = 256
const TableMessageEntriesHere = 28
const TableMessageRefBitsHere = 5
Variables ¶
var EnvelopeTableFields = []TableFieldInfo{ {Name: "id", Json: "id", TypeName: "string", DeclaredTypeName: "string", Id: 0x8b72e07b55c3ac0, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.Id)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Id)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.IdLength)), PresentOffset: 0xffffffff, CookOffset: 0, CookElemSize: 1, CookCountOffset: 68, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "from", Json: "from", TypeName: "string", DeclaredTypeName: "string", Id: 0x7f845078d7a5c0b5, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.From)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.From)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.FromLength)), PresentOffset: 0xffffffff, CookOffset: 72, CookElemSize: 1, CookCountOffset: 140, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "to", Json: "to", TypeName: "Name", DeclaredTypeName: "Name", Id: 0x8c83907b56ac0a4, Kind: 13, IsArray: true, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.To)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.To[0])), CountOffset: uint32(unsafe.Offsetof(Envelope{}.ToCount)), PresentOffset: 0xffffffff, CookOffset: 144, CookElemSize: 72, CookCountOffset: 4752, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: NameTableType, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "cc", Json: "cc", TypeName: "Name", DeclaredTypeName: "Name", Id: 0x8a24d07b54a1363, Kind: 13, IsArray: true, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.Cc)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Cc[0])), CountOffset: uint32(unsafe.Offsetof(Envelope{}.CcCount)), PresentOffset: 0xffffffff, CookOffset: 4756, CookElemSize: 72, CookCountOffset: 9364, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: NameTableType, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "re", Json: "re", TypeName: "string", DeclaredTypeName: "string", Id: 0x8dc4f07b57b8f10, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.Re)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Re)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.ReLength)), PresentOffset: 0xffffffff, CookOffset: 9368, CookElemSize: 1, CookCountOffset: 9436, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "kind", Json: "kind", TypeName: "Kind", DeclaredTypeName: "Kind", Id: 0xef9c96d721673243, Kind: 30, IsArray: false, Counted: false, Optional: false, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Envelope{}.Kind)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Kind)), CountOffset: 0xffffffff, PresentOffset: 0xffffffff, CookOffset: 9440, CookElemSize: 1, CookCountOffset: 4294967295, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: 8, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: func(v uint64) string { return EnumNameKind(Kind(v)) }, VariantId: func(v uint64) uint64 { id, _ := Kind(v).TableEnumId(); return id }, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "subject", Json: "subject", TypeName: "string", DeclaredTypeName: "string", Id: 0x9640735281e90c0f, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 200, Offset: uint32(unsafe.Offsetof(Envelope{}.Subject)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Subject)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.SubjectLength)), PresentOffset: 0xffffffff, CookOffset: 9441, CookElemSize: 1, CookCountOffset: 9644, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "card", Json: "card", TypeName: "string", DeclaredTypeName: "string", Id: 0xb5614e90e87b455f, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Envelope{}.Card)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Card)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.CardLength)), PresentOffset: 0xffffffff, CookOffset: 9648, CookElemSize: 1, CookCountOffset: 9716, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "head", Json: "head", TypeName: "string", DeclaredTypeName: "string", Id: 0xa8f12cc5f9a0c03, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 40, Offset: uint32(unsafe.Offsetof(Envelope{}.Head)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Head)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.HeadLength)), PresentOffset: 0xffffffff, CookOffset: 9720, CookElemSize: 1, CookCountOffset: 9764, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "token", Json: "token", TypeName: "string", DeclaredTypeName: "string", Id: 0x26c4b17d50b3c152, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 128, Offset: uint32(unsafe.Offsetof(Envelope{}.Token)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Token)), CountOffset: uint32(unsafe.Offsetof(Envelope{}.TokenLength)), PresentOffset: 0xffffffff, CookOffset: 9768, CookElemSize: 1, CookCountOffset: 9900, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "at_ms", Json: "at_ms", TypeName: "int64", DeclaredTypeName: "int64", Id: 0x41fdbf81bf00fdc1, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Envelope{}.AtMs)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.AtMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Envelope{}.AtMsPresent)), CookOffset: 9904, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 9912, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "due_ms", Json: "due_ms", TypeName: "int64", DeclaredTypeName: "int64", Id: 0x26095ca7d9d66c8e, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Envelope{}.DueMs)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.DueMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Envelope{}.DueMsPresent)), CookOffset: 9920, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 9928, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "body", Json: "body", TypeName: "string", DeclaredTypeName: "string", Id: 0xcd4de79bc6c93295, Kind: 17, IsArray: false, Counted: false, Optional: false, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Envelope{}.Body)), ElemSize: uint32(unsafe.Sizeof(Envelope{}.Body)), CountOffset: 0xffffffff, PresentOffset: 0xffffffff, CookOffset: 9936, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: true, TargetId: 0x704be0d8faaffc58, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, }
EnvelopeTableFields is Envelope's per-field reflection data (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var ErrValidation = errors.New("buswire: wire validation failed")
ErrValidation is returned when a read rejects the wire: a wrong constant, nonzero reserved bits, or an interior null in a string (SPEC §4.3, §4.7).
var NameTableFields = []TableFieldInfo{ {Name: "s", Json: "s", TypeName: "string", DeclaredTypeName: "string", Id: 0xaf63ee4c86020b22, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Name{}.S)), ElemSize: uint32(unsafe.Sizeof(Name{}.S)), CountOffset: uint32(unsafe.Offsetof(Name{}.SLength)), PresentOffset: 0xffffffff, CookOffset: 0, CookElemSize: 1, CookCountOffset: 68, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: -1, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: nil, VariantId: nil, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, }
NameTableFields is Name's per-field reflection data (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var TableCookByteOrder = tableCookNativeOrder()
TableCookByteOrder is THIS BUILD's byte order, as §7.1's order word records it. The byte order is settled AT COOK TIME for the target build, so a matching build version already means a matching order and Open never fixes anything up; a cook whose recorded order is not this build's is simply not this build's file.
Functions ¶
func AnnounceMeasure ¶
func AnnounceMeasure() int64
func AnnounceRead ¶
func AnnounceRead(v *TableVocabulary, data []byte, report *TableReport) bool
func EnumNameKind ¶
EnumNameKind: debug/log/tooling name for any Kind wire value — out-of-set values (wire-legal up to the declared max) name as "???"
func EnvelopeCookFrom ¶
func EnvelopeCookFrom(value *Envelope, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
func EnvelopeCookMeasure ¶
func EnvelopeCookMeasure(value *Envelope, context ...TableWriteContext) int64
func EnvelopeCookMeasureReason ¶
func EnvelopeCookMeasureReason(value *Envelope, context ...TableWriteContext) (int64, error)
func EnvelopeFromJson ¶
func EnvelopeFromJson(builder *EnvelopeBuilder, text []byte, report *TableReport) bool
func EnvelopeLoadBody ¶
func EnvelopeLoadBody(r *TableReader, value *Envelope) bool
func EnvelopeLoadBodyRetain ¶
func EnvelopeLoadBodyRetain(r *TableRetainReader, value *Envelope) bool
func EnvelopeLoadBuilder ¶
func EnvelopeLoadBuilder(b *EnvelopeBuilder, wire []byte, report *TableReport) bool
func EnvelopeLoadMeasure ¶
func EnvelopeLoadMessageBody ¶
func EnvelopeLoadMessageBody(r *TableMessageReader, value *Envelope) bool
func EnvelopeLoadMessageBodyRetain ¶
func EnvelopeLoadMessageBodyRetain(r *TableRetainMessageReader, value *Envelope) bool
func EnvelopeMeasure ¶
func EnvelopeMeasure(value *Envelope, context ...TableWriteContext) int64
func EnvelopeMeasureBody ¶
func EnvelopeMeasureBodyRetain ¶
func EnvelopeMeasureBodyRetain(value *Envelope, ids *TableRetainIds) int64
func EnvelopeMeasureReason ¶
func EnvelopeMeasureReason(value *Envelope, context ...TableWriteContext) (int64, error)
func EnvelopeMeasureRetain ¶
func EnvelopeMeasureRetain(value *Envelope, retain *TableRetain, allocator ...TableAllocator) int64
func EnvelopeOpen ¶
func EnvelopeOpen(cook *EnvelopeCook, base unsafe.Pointer, length int64) bool
EnvelopeOpen is the bool convenience for the typed Open error on the handle.
func EnvelopeReset ¶
func EnvelopeReset(value *Envelope)
EnvelopeReset restores Envelope's declared defaults in place, reusing the storage the value already holds. The reader calls it before overlaying.
func EnvelopeSave ¶
func EnvelopeSave(value *Envelope, buffer []byte, context ...TableWriteContext) int64
func EnvelopeSaveBody ¶
func EnvelopeSaveBody(w *TableWriter, value *Envelope) bool
func EnvelopeSaveBodyFields ¶
func EnvelopeSaveBodyFields(w *TableWriter, value *Envelope) bool
func EnvelopeSaveBodyFieldsRetain ¶
func EnvelopeSaveBodyFieldsRetain(w *TableRetainWriter, value *Envelope) bool
func EnvelopeSaveBodyRetain ¶
func EnvelopeSaveBodyRetain(w *TableRetainWriter, value *Envelope) bool
func EnvelopeSaveMessageBody ¶
func EnvelopeSaveMessageBody(w *TableMessageWriter, value *Envelope) bool
func EnvelopeSaveRetain ¶
func EnvelopeSaveRetain(value *Envelope, retain *TableRetain, buffer []byte, report *TableReport, allocator ...TableAllocator) int64
func EnvelopeSaveText ¶
func EnvelopeSaveText(value *Envelope, context ...TableWriteContext) (string, error)
EnvelopeSaveText returns the base64 of Envelope's binary wire (mas-bandwidth/schema docs/SPEC-TABLES.md §16.8): the whole file, form byte first, so the text keeps the form byte, the framing check and every versioning guarantee and is opaque. It takes the write context EnvelopeSave takes.
func EnvelopeToJson ¶
func EnvelopeToJson(value *Envelope, buffer []byte, allocator ...TableAllocator) int64
func EnvelopeToJsonMeasure ¶
func EnvelopeToJsonMeasure(value *Envelope, allocator ...TableAllocator) int64
func NameCookFrom ¶
func NameCookFrom(value *Name, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
func NameCookMeasure ¶
func NameCookMeasure(value *Name, context ...TableWriteContext) int64
func NameCookMeasureReason ¶
func NameCookMeasureReason(value *Name, context ...TableWriteContext) (int64, error)
func NameFromJson ¶
func NameFromJson(builder *NameBuilder, text []byte, report *TableReport) bool
func NameLoadBody ¶
func NameLoadBody(r *TableReader, value *Name) bool
func NameLoadBodyRetain ¶
func NameLoadBodyRetain(r *TableRetainReader, value *Name) bool
func NameLoadBuilder ¶
func NameLoadBuilder(b *NameBuilder, wire []byte, report *TableReport) bool
func NameLoadMeasure ¶
func NameLoadMeasureReason ¶
func NameLoadMessageBody ¶
func NameLoadMessageBody(r *TableMessageReader, value *Name) bool
func NameLoadMessageBodyRetain ¶
func NameLoadMessageBodyRetain(r *TableRetainMessageReader, value *Name) bool
func NameMeasure ¶
func NameMeasure(value *Name, context ...TableWriteContext) int64
func NameMeasureBody ¶
func NameMeasureBodyRetain ¶
func NameMeasureBodyRetain(value *Name, ids *TableRetainIds) int64
func NameMeasureReason ¶
func NameMeasureReason(value *Name, context ...TableWriteContext) (int64, error)
func NameMeasureRetain ¶
func NameMeasureRetain(value *Name, retain *TableRetain, allocator ...TableAllocator) int64
func NameReset ¶
func NameReset(value *Name)
NameReset restores Name's declared defaults in place, reusing the storage the value already holds. The reader calls it before overlaying.
func NameSaveBody ¶
func NameSaveBody(w *TableWriter, value *Name) bool
func NameSaveBodyFields ¶
func NameSaveBodyFields(w *TableWriter, value *Name) bool
func NameSaveBodyFieldsRetain ¶
func NameSaveBodyFieldsRetain(w *TableRetainWriter, value *Name) bool
func NameSaveBodyRetain ¶
func NameSaveBodyRetain(w *TableRetainWriter, value *Name) bool
func NameSaveMessageBody ¶
func NameSaveMessageBody(w *TableMessageWriter, value *Name) bool
func NameSaveRetain ¶
func NameSaveRetain(value *Name, retain *TableRetain, buffer []byte, report *TableReport, allocator ...TableAllocator) int64
func NameSaveText ¶
func NameSaveText(value *Name, context ...TableWriteContext) (string, error)
NameSaveText returns the base64 of Name's binary wire (mas-bandwidth/schema docs/SPEC-TABLES.md §16.8): the whole file, form byte first, so the text keeps the form byte, the framing check and every versioning guarantee and is opaque. It takes the write context NameSave takes.
func NameToJson ¶
func NameToJson(value *Name, buffer []byte, allocator ...TableAllocator) int64
func NameToJsonMeasure ¶
func NameToJsonMeasure(value *Name, allocator ...TableAllocator) int64
func TableBytesEmplace ¶
func TableBytesEmplace(worker *TableWorker, slot *TableRef, length int64) []byte
func TableStringEmplace ¶
func TableStringEmplace(worker *TableWorker, slot *TableRef, text []byte) []byte
Types ¶
type Envelope ¶
type Envelope = EnvelopeRow
func EnvelopeLoad ¶
func EnvelopeLoad(region, wire []byte, report *TableReport) *Envelope
func EnvelopeLoadRetain ¶
func EnvelopeLoadRetain(region, wire []byte, retain *TableRetain, report *TableReport) *Envelope
func EnvelopeLoadText ¶
func EnvelopeLoadText(text string, report *TableReport) (*Envelope, error)
EnvelopeLoadText reads one Envelope from a base64 wire text (mas-bandwidth/schema docs/SPEC-TABLES.md §16.8) into a builder of its own and returns the locked root, as EnvelopeReadStrict does: it is the STRICT read (§6.5) and refuses whenever the read's report holds an error (TableReport.Err), whatever the tolerant LoadBuilder answered, so a recovered value never comes back. It refuses by name: base64_damaged when the body does not decode, unknown_form when the decoded wire's form byte is not one this build carries, wire_damaged for framing damage, and the report's own reason (malformed, clamped, kind_mismatch, ...) otherwise. A nil report is allowed; a supplied one receives THIS read's report, so earlier counts in it never decide.
func EnvelopeReadStrict ¶
EnvelopeReadStrict is the STRICT read (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5): one call, its own builder, one typed reason.
type EnvelopeBuilder ¶
type EnvelopeBuilder struct {
Arena TableArena
Main TableWorker
// contains filtered or unexported fields
}
func (*EnvelopeBuilder) AsConst ¶
func (b *EnvelopeBuilder) AsConst() *Envelope
func (*EnvelopeBuilder) GetRoot ¶
func (b *EnvelopeBuilder) GetRoot() *Envelope
func (*EnvelopeBuilder) Init ¶
func (b *EnvelopeBuilder) Init(allocator ...TableAllocator) bool
func (*EnvelopeBuilder) Lock ¶
func (b *EnvelopeBuilder) Lock() bool
func (*EnvelopeBuilder) PackMeasure ¶
func (b *EnvelopeBuilder) PackMeasure() int64
func (*EnvelopeBuilder) PackMeasureReason ¶
func (b *EnvelopeBuilder) PackMeasureReason() (int64, error)
func (*EnvelopeBuilder) Region ¶
func (b *EnvelopeBuilder) Region() []byte
func (*EnvelopeBuilder) Shutdown ¶
func (b *EnvelopeBuilder) Shutdown()
type EnvelopeCook ¶
type EnvelopeCook struct {
Region unsafe.Pointer // the DATA part's base: the root sits at offset zero
RegionLength int64 // data_length, as the header framed it
}
EnvelopeCook is Envelope's cook: a pointer and a length, and then the root where it lies. Opening one is a HEADER MATCH and no copy; a reference is one add (mas-bandwidth/schema docs/SPEC-TABLES.md §7).
`Cook` is a CLAIMED suffix (§11). C++ spells the same claimed verbs as free functions — EnvelopeOpen, EnvelopeAt — and so does Go, because Go has free functions; what is a MEMBER here is only what §11 leaves a language free to make one.
THE MEMORY IS THE CONSUMER'S. Nothing here allocates, nothing here copies and nothing here pins: the region must stay put and stay aligned for as long as this handle or anything reached through it is used.
func (*EnvelopeCook) Open ¶
func (cook *EnvelopeCook) Open(base unsafe.Pointer, length int64) error
Open checks the header in SPEC §7 order, bytewise until base alignment is established. A successful match points at the region and allocates nothing.
func (EnvelopeCook) RegionAlignment ¶
func (c EnvelopeCook) RegionAlignment() int64
§7.1's constants, so a consumer reading this file has the facts and not a description of them. They are METHODS because §11 leaves a language whose accessors are members free to spell them that way, and a package constant per table per fact would claim names §11 does not.
func (EnvelopeCook) Root ¶
func (c EnvelopeCook) Root() *EnvelopeRow
Root is the root record at the region's base. It is a POINTER and not a copy: a cooked graph is walked by adding deltas to slot addresses.
func (EnvelopeCook) RootAlign ¶
func (c EnvelopeCook) RootAlign() int64
func (EnvelopeCook) RootSize ¶
func (c EnvelopeCook) RootSize() int64
func (EnvelopeCook) Type ¶
func (c EnvelopeCook) Type() *TableCookInfo
Type is Envelope's cooked-record descriptor, the head of the graph a reflective walk follows (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type EnvelopeRow ¶
type EnvelopeRow struct {
Id [65]byte // string(64): buffer, used length beside it
IdLength int32
From [65]byte // string(64): buffer, used length beside it
FromLength int32
To [64]NameRow
ToCount int32
Cc [64]NameRow
CcCount int32
Re [65]byte // string(64): buffer, used length beside it
ReLength int32
Kind Kind
Subject [201]byte // string(200): buffer, used length beside it
SubjectLength int32
Card [65]byte // string(64): buffer, used length beside it
CardLength int32
Head [41]byte // string(40): buffer, used length beside it
HeadLength int32
Token [129]byte // string(128): buffer, used length beside it
TokenLength int32
AtMs int64
AtMsPresent bool // ?: one byte, in Go's model as in C++
DueMs int64
DueMsPresent bool // ?: one byte, in Go's model as in C++
Body int64 // *: signed self-relative delta, zero is null (§6.3)
// contains filtered or unexported fields
}
EnvelopeRow — a cooked record. `Row` is a CLAIMED suffix (mas-bandwidth/schema docs/SPEC-TABLES.md §11), so no declaration in the unit can take it.
func EnvelopeAt ¶
func EnvelopeAt(slot *int64, arena ...*TableArena) *EnvelopeRow
EnvelopeAt dereferences a reference, and it is the same call in a locked region and an opened cook because they are the same encoding (§6.3): the slot is eight bytes, SIGNED, self-relative from the SLOT'S OWN ADDRESS, so a deref needs no base pointer and no bounds test, and NULL IS A DELTA OF ZERO. Nothing about this call is the cook's: it is what a region reference is, and a cook is a region written verbatim.
It takes the SLOT and not its value, because a self-relative delta means nothing without the address it is relative to.
type Kind ¶
type Kind uint8
Kind — None = 0 implicit, variants dense from 1, wire range [0, 8] (SPEC §4.2)
func (Kind) TableEnumId ¶
TableEnumId: Kind on the TABLE wire rides as the 64-bit hash of its VARIANT NAME, so a variant may be added anywhere, removed, or reordered and old data still reads (mas-bandwidth/schema docs/SPEC-TABLES.md §5). None uses reference zero; hash zero remains a valid named id. The bool is false when no variant names this value: no wire identity.
func (*Kind) TableEnumValue ¶
TableEnumValue resolves a table-wire variant id to a Kind, in place. The bool is false for an id this build cannot name; the value is left at None, which is what an unknown variant reads as (mas-bandwidth/schema docs/SPEC-TABLES.md §5).
type Name ¶
type Name = NameRow
func NameLoad ¶
func NameLoad(region, wire []byte, report *TableReport) *Name
func NameLoadRetain ¶
func NameLoadRetain(region, wire []byte, retain *TableRetain, report *TableReport) *Name
func NameLoadText ¶
func NameLoadText(text string, report *TableReport) (*Name, error)
NameLoadText reads one Name from a base64 wire text (mas-bandwidth/schema docs/SPEC-TABLES.md §16.8) into a builder of its own and returns the locked root, as NameReadStrict does: it is the STRICT read (§6.5) and refuses whenever the read's report holds an error (TableReport.Err), whatever the tolerant LoadBuilder answered, so a recovered value never comes back. It refuses by name: base64_damaged when the body does not decode, unknown_form when the decoded wire's form byte is not one this build carries, wire_damaged for framing damage, and the report's own reason (malformed, clamped, kind_mismatch, ...) otherwise. A nil report is allowed; a supplied one receives THIS read's report, so earlier counts in it never decide.
func NameReadStrict ¶
NameReadStrict is the STRICT read (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5): one call, its own builder, one typed reason.
type NameBuilder ¶
type NameBuilder struct {
Arena TableArena
Main TableWorker
// contains filtered or unexported fields
}
func (*NameBuilder) AsConst ¶
func (b *NameBuilder) AsConst() *Name
func (*NameBuilder) GetRoot ¶
func (b *NameBuilder) GetRoot() *Name
func (*NameBuilder) Init ¶
func (b *NameBuilder) Init(allocator ...TableAllocator) bool
func (*NameBuilder) Lock ¶
func (b *NameBuilder) Lock() bool
func (*NameBuilder) PackMeasure ¶
func (b *NameBuilder) PackMeasure() int64
func (*NameBuilder) PackMeasureReason ¶
func (b *NameBuilder) PackMeasureReason() (int64, error)
func (*NameBuilder) Region ¶
func (b *NameBuilder) Region() []byte
func (*NameBuilder) Shutdown ¶
func (b *NameBuilder) Shutdown()
type NameCook ¶
type NameCook struct {
Region unsafe.Pointer // the DATA part's base: the root sits at offset zero
RegionLength int64 // data_length, as the header framed it
}
NameCook is Name's cook: a pointer and a length, and then the root where it lies. Opening one is a HEADER MATCH and no copy; a reference is one add (mas-bandwidth/schema docs/SPEC-TABLES.md §7).
`Cook` is a CLAIMED suffix (§11). C++ spells the same claimed verbs as free functions — NameOpen, NameAt — and so does Go, because Go has free functions; what is a MEMBER here is only what §11 leaves a language free to make one.
THE MEMORY IS THE CONSUMER'S. Nothing here allocates, nothing here copies and nothing here pins: the region must stay put and stay aligned for as long as this handle or anything reached through it is used.
func (*NameCook) Open ¶
Open checks the header in SPEC §7 order, bytewise until base alignment is established. A successful match points at the region and allocates nothing.
func (NameCook) RegionAlignment ¶
§7.1's constants, so a consumer reading this file has the facts and not a description of them. They are METHODS because §11 leaves a language whose accessors are members free to spell them that way, and a package constant per table per fact would claim names §11 does not.
func (NameCook) Root ¶
Root is the root record at the region's base. It is a POINTER and not a copy: a cooked graph is walked by adding deltas to slot addresses.
func (NameCook) Type ¶
func (c NameCook) Type() *TableCookInfo
Type is Name's cooked-record descriptor, the head of the graph a reflective walk follows (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type NameRow ¶
type NameRow struct {
S [65]byte // string(64): buffer, used length beside it
SLength int32
// contains filtered or unexported fields
}
NameRow — a cooked record. `Row` is a CLAIMED suffix (mas-bandwidth/schema docs/SPEC-TABLES.md §11), so no declaration in the unit can take it.
func NameAt ¶
func NameAt(slot *int64, arena ...*TableArena) *NameRow
NameAt dereferences a reference, and it is the same call in a locked region and an opened cook because they are the same encoding (§6.3): the slot is eight bytes, SIGNED, self-relative from the SLOT'S OWN ADDRESS, so a deref needs no base pointer and no bounds test, and NULL IS A DELTA OF ZERO. Nothing about this call is the cook's: it is what a region reference is, and a cook is a region written verbatim.
It takes the SLOT and not its value, because a self-relative delta means nothing without the address it is relative to.
type TableAllocator ¶
TableAllocator owns authoring and temporary writer storage. Both callbacks are required together; an empty pair uses Go-owned storage. Alloc supplies zeroed bytes aligned to tableRegionAlign and may return more than requested. Free always receives the original slice, with its original length and base. Load and LoadMeasure use caller buffers and never call this pair.
type TableArena ¶
type TableArena struct {
Allocator TableAllocator
Locked bool
// contains filtered or unexported fields
}
func (*TableArena) Init ¶
func (a *TableArena) Init(allocator ...TableAllocator) bool
func (*TableArena) Shutdown ¶
func (a *TableArena) Shutdown()
type TableBitReader ¶
func (*TableBitReader) Align ¶
func (r *TableBitReader) Align() bool
func (*TableBitReader) Skip ¶
func (r *TableBitReader) Skip(n int64) bool
type TableBitWriter ¶
TableBitWriter uses the packet wire's low-bit-first order. Measuring walks the identical stream, including alignment, without touching a buffer.
func (*TableBitWriter) Align ¶
func (w *TableBitWriter) Align()
func (*TableBitWriter) Put ¶
func (w *TableBitWriter) Put(value uint64, n int64)
func (*TableBitWriter) Raw ¶
func (w *TableBitWriter) Raw(data []byte)
type TableBlob ¶
Blob ABI follows the established tool and C++ byte contract: u32 length, u32 zero. SPEC-TABLES §7.2 currently labels this u64; the big-endian fixtures distinguish them.
func TableBlobAt ¶
func TableBlobAt(slot *TableRef, arena ...*TableArena) *TableBlob
type TableBuildVersionMismatch ¶
type TableBuildVersionMismatch struct{ Peer, Own uint64 }
TableBuildVersionMismatch is the typed error a strict announcement refusal reports (mas-bandwidth/schema docs/SPEC-TABLES.md §3.3): the peer's build version and the reader's own, each a 64-bit number.
func (TableBuildVersionMismatch) Error ¶
func (m TableBuildVersionMismatch) Error() string
type TableByteOrder ¶
type TableByteOrder uint8
TableByteOrder selects the target order, independently of the writing host.
const ( TableByteOrderLittle TableByteOrder = 1 TableByteOrderBig TableByteOrder = 2 )
type TableBytesView ¶
TableBytesView borrows its backing region or arena. Keep that storage alive and do not free, reuse, or shut it down while using the view.
func TableBytesAt ¶
func TableBytesAt(slot *TableRef, arena ...*TableArena) TableBytesView
type TableCookFieldInfo ¶
type TableCookFieldInfo struct {
Name string
Offset int32 // the field's offset in the record this descriptor describes
Size int32 // its whole storage there, companions included
ElemSize int32 // one element's size, for an array; the field's own otherwise
IsArray bool
ArrayBound int32 // the DECLARED bound: a counted array's N, a string's or bytes' length
IsPointer bool // an eight-byte SIGNED SELF-RELATIVE delta slot (§6.3)
CountOffset int32 // the count companion's offset, or -1 when the field has none
PresentOffset int32 // an optional's presence bool, or -1
Storage TableCookStorage
// Record is the record this field NAMES, behind a function so the table
// stays constructible in any order — Go refuses an initialisation cycle
// among package-level variables, and the DESCRIPTOR graph is cyclic by
// design: a record's field column can name its own record. A cooked REGION
// is never cyclic; schema cook refuses one by name (§3.1).
// nil when the field is a scalar. Following it is how a walker DESCENDS: a
// pointer's target, a by-value nesting, and an array's element are all
// reached through this one column.
Record func() *TableCookInfo
}
TableCookFieldInfo is one record's field as DATA — the mechanism behind a reflective read of a cooked region, and what a gate walks a whole graph with. A field carries the facts a region actually has: where it sits, how big it is, whether it is a POINTER EDGE, the bound its COUNT COMPANION is checked against, and the record it names.
type TableCookInfo ¶
type TableCookInfo struct {
Name string
Size int32
Align int32
NumFields int32
Fields []TableCookFieldInfo
}
TableCookInfo is one cooked record's layout as DATA.
type TableCookStorage ¶
type TableCookStorage uint8
TableCookStorage is what a cooked SLOT holds, which is not always what the WIRE carries: an ENUM slot holds the ORDINAL at the enum's own derived storage width (mas-bandwidth/schema docs/SPEC-TABLES.md §7.2), where the wire rides the variant-name hash. A walker reads a slot with the width ElemSize gives and the signedness this names.
Its members are FLAT package-level constants, which is what Go already does with every enum a schema declares (SPEC.md §6.1's Go column) — so all eight spellings are claimed in mas-bandwidth/schema internal/tablenames, exactly as a declared enum's variants are claimed by the checker. C# spells the same vocabulary as one scoped enum and claims one name; the port does not get to have it both ways, and the flat form is the one a Go consumer expects to write.
const ( TableCookStorageRecord TableCookStorage = iota // a nested record, or an array of them: descend through it TableCookStorageReference // an eight-byte SIGNED SELF-RELATIVE delta slot (§6.3) TableCookStorageBool TableCookStorageSigned TableCookStorageUnsigned // an unsigned integer, an enum ordinal, a bits(N), a flags mask TableCookStorageFloat TableCookStorageString // char[N + 1] with an int32 used length beside it TableCookStorageBytes // uint8[N] with an int32 used length beside it )
type TableFieldInfo ¶
type TableFieldInfo struct {
CookOffset, CookElemSize, CookCountOffset, CookPresentOffset uint32
List, Map bool // unbounded by-value containers
ElemAlign uint32
Name string // schema field name, e.g. "health"
Json string // the TEXT form's key: the json = "key" attribute, else Name (§16.3)
TypeName string // schema element type, e.g. "float32", "Grade"
DeclaredTypeName string // complete schema spelling including arrays, bounds and pointers
Id uint64 // table-wire field id (name hash; the was alias's hash after a rename)
Pointer bool
TargetId uint64
Kind uint8 // table-wire kind; for arrays/strings/bytes, the ELEMENT kind
IsArray bool // fixed or counted array (bytes included)
Counted bool // a <Name>Count/<Name>Length int32 companion exists
Optional bool // a ?T field: a <Name>Present bool decides whether it rides
ArrayBound int32 // array capacity / string max length; 0 for plain scalars
Offset uint32 // unsafe.Offsetof the storage member
ElemSize uint32 // unsafe.Sizeof the member (element size for arrays)
CountOffset uint32 // unsafe.Offsetof the count/length companion, or 0xffffffff
PresentOffset uint32 // unsafe.Offsetof the Present companion, or 0xffffffff
FracBits uint8 // fixed-point binary scale
WideRange bool
WideMin, WideMax [2]uint64 // exact two-complement raw bounds, low lane first
HasRange bool // a declared [min, max] (int or float)
RangeMin float64 // NOTE: int64 ranges beyond 2^53 lose precision here
RangeMax float64
// EnumMax bounds the vocabulary: enums, the highest valid value (None = 0
// is always valid); unions, the arm count (tag range [0, EnumMax]); a
// FLAGS field, the highest declared BIT INDEX; else -1.
EnumMax int64
// EnumName is the vocabulary's names, indexed the way EnumMax bounds: an
// enum's value -> name, a union's tag -> arm name, a FLAGS field's bit
// index -> variant name. nil for every other kind.
EnumName func(value uint64) string
// VariantId is the TABLE-WIRE id of one variant (mas-bandwidth/schema docs/SPEC-TABLES.md §5): for
// an enum, the hash of the variant's name; for a union, the hash of the
// arm's name. Hash zero is an ordinary id; ordinal zero is None. nil
// for every other kind — a FLAGS field's variants have no per-variant wire
// id (§4), so a nil here beside a non-nil EnumName is what says "flags".
VariantId func(value uint64) uint64
// an ENUM-KEYED array (mas-bandwidth/schema docs/SPEC-TABLES.md §2.4, §8): the array has one slot
// per variant of KeyTypeName, indexed by the variant's value, and its
// slots ride under variant ids rather than positions. KeyName and KeyId
// are the key's vocabulary — walk [0, ArrayBound) to print slots by name.
// All three are nil/"" on every other field.
KeyTypeName string
KeyName func(value uint64) string
KeyId func(value uint64) uint64
// Arms is a union field's shape: the tag and the arms indexed by it, behind
// a function so a descriptor graph needs no initialization order. nil for
// every other kind.
Arms func() *TableUnionInfo
Guard string // branch guard, e.g. "at_rest" or "!at_rest"; "" if unguarded
// Table is the nested table's descriptor, or nil. Held as a factory rather
// than a value so a descriptor graph needs no initialization order: Go
// refuses an initialization cycle across package-level variables, and a
// table may name one declared later.
Table func() *TableTypeInfo
// what a PERSON wrote about the field (mas-bandwidth/schema docs/SPEC-TABLES.md §8.1): the ///
// block above it, verbatim (SPEC §4.1). It is TableDocNone when there is
// none, never nil. Its tags (SPEC §4.2) follow in declared order, and an
// untagged field is 0 beside a nil list. Static package data, allocating
// nothing.
Doc string
NumTags int32
Tags []string
}
TableFieldInfo is one field's descriptor.
type TableFixedDst ¶
type TableFixedEntry ¶
type TableFixedEntry struct {
Src, Dst, Size, Aux, Guard uint32
// Arg IS THE GUARD'S ORDINAL AT FULL WIDTH (mas-bandwidth/schema docs/FIXED-FORM-ALGORITHM.md
// §4.1: arg : u64, "no byte lane anywhere"): a union past 255 arms or an
// enum past 65535 variants holds its ordinal whole in this lane, and the
// compare is made against the 64-bit tag load, never a truncation of it.
Arg uint64
// Guard2 / Arg2 / ArgW2 ARE THE OUTER TAG AN ARM INSIDE AN ARM ALSO ANSWERS
// TO (mas-bandwidth/schema docs/FIXED-FORM-ALGORITHM.md §4.1): the entry runs only when BOTH tags
// hold their ordinal. ArgW2 of zero is "no outer tag", so a plan that never
// nests a union leaves the lane unset and the read is unchanged.
Guard2 uint32
Arg2 uint64
// GuardIndex / GuardCount ARE THE GUARD CHAIN (mas-bandwidth/schema docs/FIXED-FORM-ALGORITHM.md
// §4.1): offset+count into a pool of (guard, arg, argw) links, OUTERMOST
// FIRST. GuardIndex is a BYTE OFFSET from the plan's own base, where the pool
// is laid behind the entries the way the ordinal remap tables are, so the
// plan stays one slice and the read loop one signature. Every guarded entry
// carries its whole chain; the two lanes above stay its innermost two, the
// special case, so the loop walks the pool only for a chain past two. The
// only bound on a chain is the layout's 64 (tableFixedMaxDepth).
GuardIndex, GuardCount uint32
Op, ArgW, DstSize, Sign, Meta, ArgW2 uint8
}
Arg is the guard's arm ordinal: tableFixedRun compares src[Guard] against it. Meta is a text entry's flavour (tableFixedTextUtf8/Wide/Bytes). They shared one lane until reference-fix 12; compiling a string under a union arm overwrote the guard with the flavour and the read skipped the string. tableFixedEntryBytes is the FILE layout entry (id+kind+size+children), not this in-memory plan row — Meta does not ride the wire. ArgW IS THE GUARD'S WIDTH IN BYTES (§5.2 THE GUARD'S WIDTH): a union tag is one, two, four or eight bytes, clamped 1..8, and 0 reads as 1. The guard is tested at that FULL width and never at its first byte — a foreign two-byte tag 0x0101 is not arm 1. Arg is the arm ordinal and carries NO BYTE LANE (§5.8 row 5): a 256-arm union's ordinal does not fit a byte.
type TableFixedGuardLink ¶
TableFixedGuardLink is ONE LINK of a guard chain (mas-bandwidth/schema docs/FIXED-FORM-ALGORITHM.md §4.1): the offset of the tag it reads, the ordinal the tag must hold, and the width it is compared at. A chain is a CONJUNCTION — every link must hold.
type TableFixedKnownLayout ¶
TableFixedKnownLayout is one locked layout: the wire hash a file is matched on, the layout bytes verbatim with its byte length BESIDE the pointer, and the RECORD SIZE taken from the lock and never from the file. The members are §5.9 #19's: hash, layout, layout_bytes, record_bytes, in that order.
type TableIds ¶
type TableIds struct {
Numbering *TableNumbering
Values [tableIdCapacity]uint64
Count int
Overflow bool
// contains filtered or unexported fields
}
TableIds interns the writer's ids in first-use order. Bucket links are one-based so its zero value is ready to use, including for hash zero.
func (*TableIds) RefAt ¶
RefAt is Ref for a compile-time-constant id. The ordinal is that id's index in TableWireIds. A hit is one load and one compare; first-use order is still append order. Truncate clears the ordinal in O(popped) so a speculative intern does not leak into the next walk. An ordinal outside the slot range falls back to Ref; it does not index slot.
type TableMessageEntry ¶
type TableMessageEntry struct {
Id uint64
Shape, Element TableMessageShape
}
type TableMessageReader ¶
type TableMessageReader struct {
Nodes TableNodeMap
Bits TableBitReader
Vocabulary *TableVocabulary
Report TableReport
IndexBits int64
}
type TableMessageShape ¶
type TableMessageWriter ¶
type TableMessageWriter struct {
TableBitWriter
IndexBits int64
Clamped int32
Numbering *TableNumbering
// contains filtered or unexported fields
}
type TableMissingRequired ¶
type TableMissingRequired struct{ Fields string }
TableMissingRequired is the typed error a strict read reports for a record that lacks a | required field (mas-bandwidth/schema docs/SPEC-TABLES.md §2.3): Fields names the missing fields, comma-separated in declaration order, at whatever depth of the record they were missing, and Error() is the report's own reason.
func (TableMissingRequired) Error ¶
func (m TableMissingRequired) Error() string
type TableNodeDirEntry ¶
type TableNodeDirEntry struct{ Offset, TypeId uint64 }
type TableNodeMap ¶
type TableNodeMap struct {
Base unsafe.Pointer
Entries []TableNodeDirEntry
Good bool
Arena bool
}
func (TableNodeMap) Resolve ¶
func (m TableNodeMap) Resolve(slot *TableRef, index, target uint64, r *TableReport)
type TableNumbering ¶
type TableNumbering struct {
// contains filtered or unexported fields
}
The root and arena keep the source storage live while pointer-free backing allocations hold the index and entries. Temporary storage is released by caller.
func (*TableNumbering) Release ¶
func (n *TableNumbering) Release()
type TableOpenVerdict ¶
type TableOpenVerdict uint8
TableOpenVerdict distinguishes an unsupported form from framing damage.
const ( TableOpenOk TableOpenVerdict = iota TableOpenRefused TableOpenDamaged TableOpenBodyStopped )
type TableReader ¶
type TableReader struct {
Nodes TableNodeMap
Buffer []byte
Offset int64
Report *TableReport
Ids []byte
Nested bool
}
TableReader holds one bounded body and a view of the file's id trailer. Sub-readers share the trailer and report, but cannot consume sibling bytes.
func (*TableReader) Body ¶
func (r *TableReader) Body() (TableReader, bool)
func (TableReader) EndsEarly ¶
func (r TableReader) EndsEarly() bool
EndsEarly only recognizes an otherwise walkable body's early terminator. Other damage is decoded normally, preserving the prefix already read.
func (*TableReader) Get8 ¶
func (r *TableReader) Get8() uint8
func (*TableReader) Get16 ¶
func (r *TableReader) Get16() uint16
func (*TableReader) Get32 ¶
func (r *TableReader) Get32() uint32
func (*TableReader) Get64 ¶
func (r *TableReader) Get64() uint64
func (*TableReader) Has ¶
func (r *TableReader) Has(n int64) bool
func (*TableReader) Leb ¶
func (r *TableReader) Leb() (uint64, bool)
A rejected integer leaves the cursor unchanged. Its spelling must be minimal and fit in 64 bits, including the tenth byte's single value bit.
func (*TableReader) Room ¶
func (r *TableReader) Room(n uint64) bool
func (*TableReader) Signed ¶
func (r *TableReader) Signed(kind uint8) int64
func (*TableReader) Skip ¶
func (r *TableReader) Skip(kind uint8) bool
func (*TableReader) Sub ¶
func (r *TableReader) Sub(n int64) TableReader
func (*TableReader) Unsigned ¶
func (r *TableReader) Unsigned(kind uint8) uint64
type TableRefuseReason ¶
type TableRefuseReason uint8
TableRefuseReason is the typed error shared by file and accelerator failures. A successful call returns nil; a failure returns its first failing clause.
const ( TableRefuseOk TableRefuseReason = iota TableRefuseNotACook TableRefuseForeignOrder TableRefuseWrongBuildVersion TableRefuseReservedNotZero TableRefuseBadAlignment TableRefuseTruncated TableRefuseUnalignedBase TableRefuseBadLayout TableRefuseUnknownForm TableRefuseCountOverLength TableRefuseCountOverExtentCap TableRefuseBlobOverSizeCap TableRefuseDataCycle TableRefuseInvalidValue TableRefuseAllocationFailed TableRefuseWireDamaged TableRefuseMalformed TableRefuseClamped TableRefuseKindMismatch TableRefuseBase64Damaged )
func (TableRefuseReason) Error ¶
func (r TableRefuseReason) Error() string
type TableReport ¶
type TableReport struct {
Retained, RetainLost int32
Verdict TableOpenVerdict // unsupported form is distinct from damage
Reason string // why the form was refused; empty for a file read
Widened int32 // a compatible wider kind preserved the value
Unknown int32 // unknown field ids skipped (newer data)
KindMismatch int32 // known id, changed type — skipped, never misdecoded
Clamped int32 // out-of-range values clamped to declared bounds
// Duplicate counts repeated text keys. Fixed-class wire fields do not raise it.
// A body carrying an id twice is legal input
// whose last occurrence wins, silently. A wire read always leaves it zero.
Duplicate int32
// MissingRequired counts required fields (mas-bandwidth/schema docs/SPEC-TABLES.md §2.3) the
// record did not carry: a record an older writer produced before the field
// became required. The refusal names the field in Reason.
MissingRequired int32
Malformed bool // framing damage; decode stopped, partial result kept
// BuildVersionPeer and BuildVersionOwn are the two build versions a strict
// announcement refusal carries (mas-bandwidth/schema docs/SPEC-TABLES.md §3.3): the peer's
// announcement and this unit's own. They are zero on every other read.
BuildVersionPeer uint64
BuildVersionOwn uint64
// LayoutHash is THE FILE'S hash, and it is set by ONE refusal:
// layout_newer reports it "AND NOTHING ELSE" (§5.3). layout_unsupported
// reports it too — the operator's other answer, a layout this build served
// and has retired.
LayoutHash uint64
}
TableReport is the table-wire read report — the permissive contract's ledger. Silence (all zero) means the data matched this reader's schema exactly. Err (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5) is the STRICT read's typed reason for malformed, clamped, kind-mismatched, unknown form, wire-damaged and build-version-mismatched. Unknown, Widened and Retained alone are not one.
func (*TableReport) Err ¶
func (r *TableReport) Err() error
Err is the report's typed error (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5, mas-bandwidth/schema docs/VERSIONING.md The read report). A strict read refuses malformed, clamped, kind-mismatched, unknown form, wire-damaged, build-version-mismatched and missing-required (§2.3, naming the field), each as one typed reason. Unknown, Widened and Retained alone leave it nil, as does a clean read.
type TableRetain ¶
type TableRetain struct {
Bytes []byte
Ids []TableRetainId
Used int64
Count int
// contains filtered or unexported fields
}
type TableRetainId ¶
type TableRetainIds ¶
type TableRetainIds struct {
Numbering *TableNumbering
Retain *TableRetain
Path tableRetainPath
Count int
Overflow, Lost bool
// contains filtered or unexported fields
}
func (*TableRetainIds) Ref ¶
func (i *TableRetainIds) Ref(id uint64) uint64
func (*TableRetainIds) Truncate ¶
func (i *TableRetainIds) Truncate(mark int)
type TableRetainMessageReader ¶
type TableRetainMessageReader struct {
Retain *TableRetain
Path tableRetainPath
// contains filtered or unexported fields
}
type TableRetainReader ¶
type TableRetainReader struct {
Retain *TableRetain
Path tableRetainPath
// contains filtered or unexported fields
}
func (*TableRetainReader) Body ¶
func (r *TableRetainReader) Body() (TableRetainReader, bool)
type TableRetainWriter ¶
type TableRetainWriter struct {
Buffer []byte
Offset int64
Overflow bool
Measuring bool
Ids *TableRetainIds
}
func (*TableRetainWriter) Advance ¶
func (w *TableRetainWriter) Advance(n int64) bool
func (*TableRetainWriter) Header ¶
func (w *TableRetainWriter) Header(ref uint64, kind uint8)
Header writes a field's reference and kind. A reference below 128 is one LEB byte, so the pair is one two-byte store. Larger references still go through PutLeb then Put8. Bytes match that two-call spelling; a pair that does not fit now leaves the buffer alone, and Save answers -1.
func (*TableRetainWriter) Id ¶
func (w *TableRetainWriter) Id(id uint64)
func (*TableRetainWriter) IdAt ¶
func (w *TableRetainWriter) IdAt(ordinal int, id uint64)
func (*TableRetainWriter) Put8 ¶
func (w *TableRetainWriter) Put8(v uint8)
func (*TableRetainWriter) Put16 ¶
func (w *TableRetainWriter) Put16(v uint16)
func (*TableRetainWriter) Put32 ¶
func (w *TableRetainWriter) Put32(v uint32)
func (*TableRetainWriter) Put64 ¶
func (w *TableRetainWriter) Put64(v uint64)
func (*TableRetainWriter) Put128 ¶
func (w *TableRetainWriter) Put128(lo, hi uint64)
Put128 writes two little-endian lanes, low first, under one Advance.
func (*TableRetainWriter) PutLeb ¶
func (w *TableRetainWriter) PutLeb(v uint64)
func (*TableRetainWriter) Raw ¶
func (w *TableRetainWriter) Raw(data []byte)
func (*TableRetainWriter) Trailer ¶
func (w *TableRetainWriter) Trailer()
type TableStringView ¶
TableStringView has the same borrowed lifetime as TableBytesView.
func TableStringAt ¶
func TableStringAt(slot *TableRef, arena ...*TableArena) TableStringView
type TableTimestampError ¶
TableTimestampError is the refusal of a time.Time that no count names: its nanoseconds since the Unix epoch do not fit an int64, which is Time.UnixNano's own domain, the years 1678 through 2262 (mas-bandwidth/schema docs/SPEC-TABLES.md §2.11).
func (TableTimestampError) Error ¶
func (e TableTimestampError) Error() string
type TableTypeInfo ¶
type TableTypeInfo struct {
SaveBodyRetain func(*TableRetainWriter, unsafe.Pointer) bool
LoadBodyRetain func(TableRetainReader, unsafe.Pointer) bool
LoadMessageBodyRetain func(TableRetainMessageReader, unsafe.Pointer) (TableRetainMessageReader, bool)
CookSize, CookAlign uint32
Name string // schema type name
Size uint32 // unsafe.Sizeof the storage struct
Id uint64
Variable bool
NodeType func(uint64) *TableTypeInfo
SaveBody func(*TableWriter, unsafe.Pointer) bool
LoadBody func(TableReader, unsafe.Pointer) bool
SaveMessageBody func(*TableMessageWriter, unsafe.Pointer) bool
LoadMessageBody func(TableMessageReader, unsafe.Pointer) (TableMessageReader, bool)
NumFields int32
Fields []TableFieldInfo
// Reset puts one instance back at its declared defaults, in place. A
// generic walker that fills a value has to be able to establish the
// defaults an absent field takes, and it holds no type to spell — this is
// the one thing the descriptors could not express without it.
Reset func(storage unsafe.Pointer)
// the declaration's own doc and tags, on the same terms as a field's
// (mas-bandwidth/schema docs/SPEC-TABLES.md §8.1, SPEC §4.1, §4.2)
Doc string
NumTags int32
Tags []string
}
TableTypeInfo is one type's descriptor.
var EnvelopeTableInfo TableTypeInfo
EnvelopeTableInfo is Envelope's reflection descriptor (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var NameTableInfo TableTypeInfo
NameTableInfo is Name's reflection descriptor (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
func EnvelopeTableType ¶
func EnvelopeTableType() *TableTypeInfo
EnvelopeTableType returns Envelope's reflection descriptor.
func NameTableType ¶
func NameTableType() *TableTypeInfo
NameTableType returns Name's reflection descriptor.
type TableUnionArmInfo ¶
type TableUnionArmInfo struct {
Field TableFieldInfo // arm shape; offsets are relative to union storage
Void bool // a selected payload-free arm
Reset func(storage unsafe.Pointer) // establish selected payload defaults
Offset uint32 // unsafe.Offsetof the arm's payload within the union storage
Table func() *TableTypeInfo // the arm payload's descriptor
}
TableUnionArmInfo is one arm of a union field: where its payload sits inside the union's storage and what its payload looks like. The arm's NAME and its table-wire id come from the field's EnumName/VariantId functions at the same tag, so nothing is spelled twice (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type TableUnionInfo ¶
type TableUnionInfo struct {
CookTagSize uint32
TagOffset uint32 // unsafe.Offsetof the tag within the union storage
TagSize uint32 // unsafe.Sizeof the tag
Arms []TableUnionArmInfo
}
TableUnionInfo is a union field's shape: the tag, and the arms indexed by it. Arms run [0, EnumMax]; index 0 is the EMPTY arm and carries no payload.
type TableVocabulary ¶
type TableVocabulary struct {
Entries []TableMessageEntry
Count, RefBits int64
BuildVersion uint64
Announced, Refused bool
MaxBytes int64
Strict bool
}
Storage belongs to the caller and is resolved once for one connection direction.
func (*TableVocabulary) Entry ¶
func (v *TableVocabulary) Entry(ref uint64) (TableMessageEntry, bool)
func (*TableVocabulary) Init ¶
func (v *TableVocabulary) Init(storage []TableMessageEntry)
type TableWorker ¶
type TableWorker struct {
Arena *TableArena
// contains filtered or unexported fields
}
func (*TableWorker) AllocBytes ¶
func (w *TableWorker) AllocBytes(length int64) ([]byte, TableRef)
func (*TableWorker) AllocString ¶
func (w *TableWorker) AllocString(length int64) ([]byte, TableRef)
type TableWriteContext ¶
type TableWriteContext interface {
// contains filtered or unexported methods
}
TableWriteContext selects allocation independently from reference addressing. Pass a TableAllocator for a loaded/locked region, or *TableArena for authoring references and that arena's allocation pair. Omit it for Go-owned temporaries.
type TableWriter ¶
TableWriter writes into the caller's buffer, or counts exactly the same bytes in Measuring mode. Offset and every length are checked before use.
func (*TableWriter) Advance ¶
func (w *TableWriter) Advance(n int64) bool
func (*TableWriter) Header ¶
func (w *TableWriter) Header(ref uint64, kind uint8)
Header writes a field's reference and kind. A reference below 128 is one LEB byte, so the pair is one two-byte store. Larger references still go through PutLeb then Put8. Bytes match that two-call spelling; a pair that does not fit now leaves the buffer alone, and Save answers -1.
func (*TableWriter) Id ¶
func (w *TableWriter) Id(id uint64)
func (*TableWriter) IdAt ¶
func (w *TableWriter) IdAt(ordinal int, id uint64)
func (*TableWriter) Put8 ¶
func (w *TableWriter) Put8(v uint8)
func (*TableWriter) Put16 ¶
func (w *TableWriter) Put16(v uint16)
func (*TableWriter) Put32 ¶
func (w *TableWriter) Put32(v uint32)
func (*TableWriter) Put64 ¶
func (w *TableWriter) Put64(v uint64)
func (*TableWriter) Put128 ¶
func (w *TableWriter) Put128(lo, hi uint64)
Put128 writes two little-endian lanes, low first, under one Advance.
func (*TableWriter) PutLeb ¶
func (w *TableWriter) PutLeb(v uint64)
func (*TableWriter) Raw ¶
func (w *TableWriter) Raw(data []byte)
func (*TableWriter) Trailer ¶
func (w *TableWriter) Trailer()
type UnitViewInfo ¶
type UnitViewInfo struct {
Package string
ProtocolId uint64
NumTypes, NumTables, NumEnums, NumFlags, NumUnions, NumConstants int32
Types, Tables []ViewType
Enums, Flags, Unions []ViewVocabulary
Constants []ViewConstant
}
func UnitView ¶
func UnitView() *UnitViewInfo
type ViewConstant ¶
type ViewConstant struct {
Name, File, TypeName string
IsFloat bool
IntValue int64
FloatValue float64
Doc string
NumTags int32
Tags []string
}
UnitView returns this build's registry. Treat its descriptors and slices as immutable; lookups allocate nothing. Packet-only types gain no table codec. A packet dependency can use different storage from its table Row; its descriptor follows that storage, so every offset remains valid for the value.
type ViewVariant ¶
type ViewVariant struct {
Value uint64
Name string
Id uint64
PayloadName string
Payload func() *TableTypeInfo
Field func() *TableFieldInfo
Doc string
NumTags int32
Tags []string
}
type ViewVocabulary ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
bus-driver
command
Command bus-driver is the bus area's Go leg for the schema conformance harness's wire fuzz (make schemawire-conformance; the wire-fuzz driver contract, test/conformance/README.md in the schema repository).
|
Command bus-driver is the bus area's Go leg for the schema conformance harness's wire fuzz (make schemawire-conformance; the wire-fuzz driver contract, test/conformance/README.md in the schema repository). |