Documentation
¶
Overview ¶
Package hookwire is the hook area's table wire, generated by the schema compiler from schemas/hook/ack.schema, schemas/hook/beat.schema and schemas/hook/stamp.schema: the Ack (a send receipt: id, stage, push, reason), the Beat (a friend beat's hot scalars) and the Stamp (the hook lease stamp, int64 millisecond times). Every other .go file here is generated: edit the .schema and run go generate ./pkg/hookwire, never the output. pkg/schemaread reads each strictly: binary wire, padded standard base64 of the wire, or JSON text, each refused by name when damaged.
Index ¶
- Constants
- Variables
- func AckCookFrom(value *Ack, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
- func AckCookMeasure(value *Ack, context ...TableWriteContext) int64
- func AckCookMeasureReason(value *Ack, context ...TableWriteContext) (int64, error)
- func AckFromJson(builder *AckBuilder, text []byte, report *TableReport) bool
- func AckLoadBody(r *TableReader, value *Ack) bool
- func AckLoadBodyRetain(r *TableRetainReader, value *Ack) bool
- func AckLoadBuilder(b *AckBuilder, wire []byte, report *TableReport) bool
- func AckLoadMeasure(wire []byte) int64
- func AckLoadMeasureReason(wire []byte) (int64, error)
- func AckLoadMessageBody(r *TableMessageReader, value *Ack) bool
- func AckLoadMessageBodyRetain(r *TableRetainMessageReader, value *Ack) bool
- func AckMeasure(value *Ack, context ...TableWriteContext) int64
- func AckMeasureBody(value *Ack, ids *TableIds) int64
- func AckMeasureBodyRetain(value *Ack, ids *TableRetainIds) int64
- func AckMeasureReason(value *Ack, context ...TableWriteContext) (int64, error)
- func AckMeasureRetain(value *Ack, retain *TableRetain, allocator ...TableAllocator) int64
- func AckOpen(cook *AckCook, base unsafe.Pointer, length int64) bool
- func AckReset(value *Ack)
- func AckSave(value *Ack, buffer []byte, context ...TableWriteContext) int64
- func AckSaveBody(w *TableWriter, value *Ack) bool
- func AckSaveBodyFields(w *TableWriter, value *Ack) bool
- func AckSaveBodyFieldsRetain(w *TableRetainWriter, value *Ack) bool
- func AckSaveBodyRetain(w *TableRetainWriter, value *Ack) bool
- func AckSaveMessageBody(w *TableMessageWriter, value *Ack) bool
- func AckSaveRetain(value *Ack, retain *TableRetain, buffer []byte, report *TableReport, ...) int64
- func AckSaveText(value *Ack, context ...TableWriteContext) (string, error)
- func AckToJson(value *Ack, buffer []byte, allocator ...TableAllocator) int64
- func AckToJsonMeasure(value *Ack, allocator ...TableAllocator) int64
- func Announce(buffer []byte) int64
- func AnnounceMeasure() int64
- func AnnounceRead(v *TableVocabulary, data []byte, report *TableReport) bool
- func BeatCookFrom(value *Beat, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
- func BeatCookMeasure(value *Beat, context ...TableWriteContext) int64
- func BeatCookMeasureReason(value *Beat, context ...TableWriteContext) (int64, error)
- func BeatFromJson(builder *BeatBuilder, text []byte, report *TableReport) bool
- func BeatLoadBody(r *TableReader, value *Beat) bool
- func BeatLoadBodyRetain(r *TableRetainReader, value *Beat) bool
- func BeatLoadBuilder(b *BeatBuilder, wire []byte, report *TableReport) bool
- func BeatLoadMeasure(wire []byte) int64
- func BeatLoadMeasureReason(wire []byte) (int64, error)
- func BeatLoadMessageBody(r *TableMessageReader, value *Beat) bool
- func BeatLoadMessageBodyRetain(r *TableRetainMessageReader, value *Beat) bool
- func BeatMeasure(value *Beat, context ...TableWriteContext) int64
- func BeatMeasureBody(value *Beat, ids *TableIds) int64
- func BeatMeasureBodyRetain(value *Beat, ids *TableRetainIds) int64
- func BeatMeasureReason(value *Beat, context ...TableWriteContext) (int64, error)
- func BeatMeasureRetain(value *Beat, retain *TableRetain, allocator ...TableAllocator) int64
- func BeatOpen(cook *BeatCook, base unsafe.Pointer, length int64) bool
- func BeatReset(value *Beat)
- func BeatSave(value *Beat, buffer []byte, context ...TableWriteContext) int64
- func BeatSaveBody(w *TableWriter, value *Beat) bool
- func BeatSaveBodyFields(w *TableWriter, value *Beat) bool
- func BeatSaveBodyFieldsRetain(w *TableRetainWriter, value *Beat) bool
- func BeatSaveBodyRetain(w *TableRetainWriter, value *Beat) bool
- func BeatSaveMessageBody(w *TableMessageWriter, value *Beat) bool
- func BeatSaveRetain(value *Beat, retain *TableRetain, buffer []byte, report *TableReport, ...) int64
- func BeatSaveText(value *Beat, context ...TableWriteContext) (string, error)
- func BeatToJson(value *Beat, buffer []byte, allocator ...TableAllocator) int64
- func BeatToJsonMeasure(value *Beat, allocator ...TableAllocator) int64
- func EnumNamePushState(value PushState) string
- func EnumNameStage(value Stage) string
- func StampCookFrom(value *Stamp, buffer []byte, order TableByteOrder, ...) bool
- func StampCookMeasure(value *Stamp, context ...TableWriteContext) int64
- func StampCookMeasureReason(value *Stamp, context ...TableWriteContext) (int64, error)
- func StampFromJson(builder *StampBuilder, text []byte, report *TableReport) bool
- func StampLoadBody(r *TableReader, value *Stamp) bool
- func StampLoadBodyRetain(r *TableRetainReader, value *Stamp) bool
- func StampLoadBuilder(b *StampBuilder, wire []byte, report *TableReport) bool
- func StampLoadMeasure(wire []byte) int64
- func StampLoadMeasureReason(wire []byte) (int64, error)
- func StampLoadMessageBody(r *TableMessageReader, value *Stamp) bool
- func StampLoadMessageBodyRetain(r *TableRetainMessageReader, value *Stamp) bool
- func StampMeasure(value *Stamp, context ...TableWriteContext) int64
- func StampMeasureBody(value *Stamp, ids *TableIds) int64
- func StampMeasureBodyRetain(value *Stamp, ids *TableRetainIds) int64
- func StampMeasureReason(value *Stamp, context ...TableWriteContext) (int64, error)
- func StampMeasureRetain(value *Stamp, retain *TableRetain, allocator ...TableAllocator) int64
- func StampOpen(cook *StampCook, base unsafe.Pointer, length int64) bool
- func StampReset(value *Stamp)
- func StampSave(value *Stamp, buffer []byte, context ...TableWriteContext) int64
- func StampSaveBody(w *TableWriter, value *Stamp) bool
- func StampSaveBodyFields(w *TableWriter, value *Stamp) bool
- func StampSaveBodyFieldsRetain(w *TableRetainWriter, value *Stamp) bool
- func StampSaveBodyRetain(w *TableRetainWriter, value *Stamp) bool
- func StampSaveMessageBody(w *TableMessageWriter, value *Stamp) bool
- func StampSaveRetain(value *Stamp, retain *TableRetain, buffer []byte, report *TableReport, ...) int64
- func StampSaveText(value *Stamp, context ...TableWriteContext) (string, error)
- func StampToJson(value *Stamp, buffer []byte, allocator ...TableAllocator) int64
- func StampToJsonMeasure(value *Stamp, allocator ...TableAllocator) int64
- func TableBytesEmplace(worker *TableWorker, slot *TableRef, length int64) []byte
- func TableStringEmplace(worker *TableWorker, slot *TableRef, text []byte) []byte
- type Ack
- type AckBuilder
- func (b *AckBuilder) AsConst() *Ack
- func (b *AckBuilder) GetRoot() *Ack
- func (b *AckBuilder) Init(allocator ...TableAllocator) bool
- func (b *AckBuilder) Lock() bool
- func (b *AckBuilder) PackMeasure() int64
- func (b *AckBuilder) PackMeasureReason() (int64, error)
- func (b *AckBuilder) Region() []byte
- func (b *AckBuilder) Shutdown()
- type AckCook
- type AckRow
- type Beat
- type BeatBuilder
- func (b *BeatBuilder) AsConst() *Beat
- func (b *BeatBuilder) GetRoot() *Beat
- func (b *BeatBuilder) Init(allocator ...TableAllocator) bool
- func (b *BeatBuilder) Lock() bool
- func (b *BeatBuilder) PackMeasure() int64
- func (b *BeatBuilder) PackMeasureReason() (int64, error)
- func (b *BeatBuilder) Region() []byte
- func (b *BeatBuilder) Shutdown()
- type BeatCook
- type BeatRow
- type PushState
- type Stage
- type Stamp
- type StampBuilder
- func (b *StampBuilder) AsConst() *Stamp
- func (b *StampBuilder) GetRoot() *Stamp
- func (b *StampBuilder) Init(allocator ...TableAllocator) bool
- func (b *StampBuilder) Lock() bool
- func (b *StampBuilder) PackMeasure() int64
- func (b *StampBuilder) PackMeasureReason() (int64, error)
- func (b *StampBuilder) Region() []byte
- func (b *StampBuilder) Shutdown()
- type StampCook
- type StampRow
- 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 AckLoadRetainBuilder = "Ack: retention requires a region round trip through the VARIABLE form"
const AckSaveRetainMessages = "Ack: retention requires a region round trip through the VARIABLE form"
const BeatLoadRetainBuilder = "Beat: retention requires a region round trip through the VARIABLE form"
const BeatSaveRetainMessages = "Beat: retention requires a region round trip through the VARIABLE form"
const BuildVersion uint64 = 0x8c4647e6606eb85b
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 ProtocolId uint64 = 0x2e2ca2804cba0512
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 StampLoadRetainBuilder = "Stamp: retention requires a region round trip through the VARIABLE form"
const StampSaveRetainMessages = "Stamp: retention requires a region round trip through the VARIABLE form"
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 = 27
const TableMessageRefBitsHere = 5
Variables ¶
var AckTableFields = []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(Ack{}.Id)), ElemSize: uint32(unsafe.Sizeof(Ack{}.Id)), CountOffset: uint32(unsafe.Offsetof(Ack{}.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: "stage", Json: "stage", TypeName: "Stage", DeclaredTypeName: "Stage", Id: 0xee9dbaad45e3448d, Kind: 30, IsArray: false, Counted: false, Optional: false, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Ack{}.Stage)), ElemSize: uint32(unsafe.Sizeof(Ack{}.Stage)), CountOffset: 0xffffffff, PresentOffset: 0xffffffff, CookOffset: 72, CookElemSize: 1, CookCountOffset: 4294967295, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: 4, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: func(v uint64) string { return EnumNameStage(Stage(v)) }, VariantId: func(v uint64) uint64 { id, _ := Stage(v).TableEnumId(); return id }, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "push", Json: "push", TypeName: "PushState", DeclaredTypeName: "PushState", Id: 0x6c80030e2762459d, Kind: 30, IsArray: false, Counted: false, Optional: false, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Ack{}.Push)), ElemSize: uint32(unsafe.Sizeof(Ack{}.Push)), CountOffset: 0xffffffff, PresentOffset: 0xffffffff, CookOffset: 73, CookElemSize: 1, CookCountOffset: 4294967295, CookPresentOffset: 4294967295, HasRange: false, RangeMin: 0.0, RangeMax: 0.0, EnumMax: 3, FracBits: 0, Pointer: false, TargetId: 0x0000000000000000, EnumName: func(v uint64) string { return EnumNamePushState(PushState(v)) }, VariantId: func(v uint64) uint64 { id, _ := PushState(v).TableEnumId(); return id }, KeyTypeName: "", KeyName: nil, KeyId: nil, Arms: nil, Guard: "", Table: nil, Doc: TableDocNone, NumTags: 0, Tags: nil}, {Name: "reason", Json: "reason", TypeName: "string", DeclaredTypeName: "string", Id: 0x65e8d7f3474f2639, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 152, Offset: uint32(unsafe.Offsetof(Ack{}.Reason)), ElemSize: uint32(unsafe.Sizeof(Ack{}.Reason)), CountOffset: uint32(unsafe.Offsetof(Ack{}.ReasonLength)), PresentOffset: 0xffffffff, CookOffset: 74, CookElemSize: 1, CookCountOffset: 228, 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}, }
AckTableFields is Ack's per-field reflection data (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var BeatTableFields = []TableFieldInfo{ {Name: "friend_name", Json: "friend_name", TypeName: "string", DeclaredTypeName: "string", Id: 0x2bcee2fac7bb6eb5, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 64, Offset: uint32(unsafe.Offsetof(Beat{}.FriendName)), ElemSize: uint32(unsafe.Sizeof(Beat{}.FriendName)), CountOffset: uint32(unsafe.Offsetof(Beat{}.FriendNameLength)), 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: "sent_ms", Json: "sent_ms", TypeName: "int64", DeclaredTypeName: "int64", Id: 0x4a47f5b32c1c056c, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Beat{}.SentMs)), ElemSize: uint32(unsafe.Sizeof(Beat{}.SentMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Beat{}.SentMsPresent)), CookOffset: 72, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 80, 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: "active_ms", Json: "active_ms", TypeName: "int64", DeclaredTypeName: "int64", Id: 0x91e4c82839ceef7c, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Beat{}.ActiveMs)), ElemSize: uint32(unsafe.Sizeof(Beat{}.ActiveMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Beat{}.ActiveMsPresent)), CookOffset: 88, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 96, 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: "until_ms", Json: "until_ms", TypeName: "int64", DeclaredTypeName: "int64", Id: 0x5f419632e10cbf3c, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Beat{}.UntilMs)), ElemSize: uint32(unsafe.Sizeof(Beat{}.UntilMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Beat{}.UntilMsPresent)), CookOffset: 104, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 112, 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: "reason", Json: "reason", TypeName: "string", DeclaredTypeName: "string", Id: 0x65e8d7f3474f2639, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 200, Offset: uint32(unsafe.Offsetof(Beat{}.Reason)), ElemSize: uint32(unsafe.Sizeof(Beat{}.Reason)), CountOffset: uint32(unsafe.Offsetof(Beat{}.ReasonLength)), PresentOffset: 0xffffffff, CookOffset: 113, CookElemSize: 1, CookCountOffset: 316, 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: "stop_returns", Json: "stop_returns", TypeName: "uint32", DeclaredTypeName: "uint32", Id: 0xea14e391abc0c981, Kind: 8, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Beat{}.StopReturns)), ElemSize: uint32(unsafe.Sizeof(Beat{}.StopReturns)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Beat{}.StopReturnsPresent)), CookOffset: 320, CookElemSize: 4, CookCountOffset: 4294967295, CookPresentOffset: 324, HasRange: true, RangeMin: 0.0, RangeMax: 1024.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}, }
BeatTableFields is Beat's per-field reflection data (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var ErrValidation = errors.New("hookwire: 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 StampTableFields = []TableFieldInfo{ {Name: "epoch", Json: "epoch", TypeName: "int64", DeclaredTypeName: "int64", Id: 0xfc9697d1196e6ba6, Kind: 5, IsArray: false, Counted: false, Optional: true, ArrayBound: 0, Offset: uint32(unsafe.Offsetof(Stamp{}.Epoch)), ElemSize: uint32(unsafe.Sizeof(Stamp{}.Epoch)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Stamp{}.EpochPresent)), CookOffset: 0, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 8, 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(Stamp{}.AtMs)), ElemSize: uint32(unsafe.Sizeof(Stamp{}.AtMs)), CountOffset: 0xffffffff, PresentOffset: uint32(unsafe.Offsetof(Stamp{}.AtMsPresent)), CookOffset: 16, CookElemSize: 8, CookCountOffset: 4294967295, CookPresentOffset: 24, 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: "by", Json: "by", TypeName: "string", DeclaredTypeName: "string", Id: 0x8a64b07b54df8d4, Kind: 12, IsArray: false, Counted: true, Optional: false, ArrayBound: 128, Offset: uint32(unsafe.Offsetof(Stamp{}.By)), ElemSize: uint32(unsafe.Sizeof(Stamp{}.By)), CountOffset: uint32(unsafe.Offsetof(Stamp{}.ByLength)), PresentOffset: 0xffffffff, CookOffset: 25, CookElemSize: 1, CookCountOffset: 156, 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}, }
StampTableFields is Stamp'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 AckCookFrom ¶
func AckCookFrom(value *Ack, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
func AckCookMeasure ¶
func AckCookMeasure(value *Ack, context ...TableWriteContext) int64
func AckCookMeasureReason ¶
func AckCookMeasureReason(value *Ack, context ...TableWriteContext) (int64, error)
func AckFromJson ¶
func AckFromJson(builder *AckBuilder, text []byte, report *TableReport) bool
func AckLoadBody ¶
func AckLoadBody(r *TableReader, value *Ack) bool
func AckLoadBodyRetain ¶
func AckLoadBodyRetain(r *TableRetainReader, value *Ack) bool
func AckLoadBuilder ¶
func AckLoadBuilder(b *AckBuilder, wire []byte, report *TableReport) bool
func AckLoadMeasure ¶
func AckLoadMeasureReason ¶
func AckLoadMessageBody ¶
func AckLoadMessageBody(r *TableMessageReader, value *Ack) bool
func AckLoadMessageBodyRetain ¶
func AckLoadMessageBodyRetain(r *TableRetainMessageReader, value *Ack) bool
func AckMeasure ¶
func AckMeasure(value *Ack, context ...TableWriteContext) int64
func AckMeasureBody ¶
func AckMeasureBodyRetain ¶
func AckMeasureBodyRetain(value *Ack, ids *TableRetainIds) int64
func AckMeasureReason ¶
func AckMeasureReason(value *Ack, context ...TableWriteContext) (int64, error)
func AckMeasureRetain ¶
func AckMeasureRetain(value *Ack, retain *TableRetain, allocator ...TableAllocator) int64
func AckReset ¶
func AckReset(value *Ack)
AckReset restores Ack's declared defaults in place, reusing the storage the value already holds. The reader calls it before overlaying.
func AckSaveBody ¶
func AckSaveBody(w *TableWriter, value *Ack) bool
func AckSaveBodyFields ¶
func AckSaveBodyFields(w *TableWriter, value *Ack) bool
func AckSaveBodyFieldsRetain ¶
func AckSaveBodyFieldsRetain(w *TableRetainWriter, value *Ack) bool
func AckSaveBodyRetain ¶
func AckSaveBodyRetain(w *TableRetainWriter, value *Ack) bool
func AckSaveMessageBody ¶
func AckSaveMessageBody(w *TableMessageWriter, value *Ack) bool
func AckSaveRetain ¶
func AckSaveRetain(value *Ack, retain *TableRetain, buffer []byte, report *TableReport, allocator ...TableAllocator) int64
func AckSaveText ¶
func AckSaveText(value *Ack, context ...TableWriteContext) (string, error)
AckSaveText returns the base64 of Ack'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 AckSave takes.
func AckToJsonMeasure ¶
func AckToJsonMeasure(value *Ack, allocator ...TableAllocator) int64
func AnnounceMeasure ¶
func AnnounceMeasure() int64
func AnnounceRead ¶
func AnnounceRead(v *TableVocabulary, data []byte, report *TableReport) bool
func BeatCookFrom ¶
func BeatCookFrom(value *Beat, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
func BeatCookMeasure ¶
func BeatCookMeasure(value *Beat, context ...TableWriteContext) int64
func BeatCookMeasureReason ¶
func BeatCookMeasureReason(value *Beat, context ...TableWriteContext) (int64, error)
func BeatFromJson ¶
func BeatFromJson(builder *BeatBuilder, text []byte, report *TableReport) bool
func BeatLoadBody ¶
func BeatLoadBody(r *TableReader, value *Beat) bool
func BeatLoadBodyRetain ¶
func BeatLoadBodyRetain(r *TableRetainReader, value *Beat) bool
func BeatLoadBuilder ¶
func BeatLoadBuilder(b *BeatBuilder, wire []byte, report *TableReport) bool
func BeatLoadMeasure ¶
func BeatLoadMeasureReason ¶
func BeatLoadMessageBody ¶
func BeatLoadMessageBody(r *TableMessageReader, value *Beat) bool
func BeatLoadMessageBodyRetain ¶
func BeatLoadMessageBodyRetain(r *TableRetainMessageReader, value *Beat) bool
func BeatMeasure ¶
func BeatMeasure(value *Beat, context ...TableWriteContext) int64
func BeatMeasureBody ¶
func BeatMeasureBodyRetain ¶
func BeatMeasureBodyRetain(value *Beat, ids *TableRetainIds) int64
func BeatMeasureReason ¶
func BeatMeasureReason(value *Beat, context ...TableWriteContext) (int64, error)
func BeatMeasureRetain ¶
func BeatMeasureRetain(value *Beat, retain *TableRetain, allocator ...TableAllocator) int64
func BeatReset ¶
func BeatReset(value *Beat)
BeatReset restores Beat's declared defaults in place, reusing the storage the value already holds. The reader calls it before overlaying.
func BeatSaveBody ¶
func BeatSaveBody(w *TableWriter, value *Beat) bool
func BeatSaveBodyFields ¶
func BeatSaveBodyFields(w *TableWriter, value *Beat) bool
func BeatSaveBodyFieldsRetain ¶
func BeatSaveBodyFieldsRetain(w *TableRetainWriter, value *Beat) bool
func BeatSaveBodyRetain ¶
func BeatSaveBodyRetain(w *TableRetainWriter, value *Beat) bool
func BeatSaveMessageBody ¶
func BeatSaveMessageBody(w *TableMessageWriter, value *Beat) bool
func BeatSaveRetain ¶
func BeatSaveRetain(value *Beat, retain *TableRetain, buffer []byte, report *TableReport, allocator ...TableAllocator) int64
func BeatSaveText ¶
func BeatSaveText(value *Beat, context ...TableWriteContext) (string, error)
BeatSaveText returns the base64 of Beat'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 BeatSave takes.
func BeatToJson ¶
func BeatToJson(value *Beat, buffer []byte, allocator ...TableAllocator) int64
func BeatToJsonMeasure ¶
func BeatToJsonMeasure(value *Beat, allocator ...TableAllocator) int64
func EnumNamePushState ¶
EnumNamePushState: debug/log/tooling name for any PushState wire value — out-of-set values (wire-legal up to the declared max) name as "???"
func EnumNameStage ¶
EnumNameStage: debug/log/tooling name for any Stage wire value — out-of-set values (wire-legal up to the declared max) name as "???"
func StampCookFrom ¶
func StampCookFrom(value *Stamp, buffer []byte, order TableByteOrder, context ...TableWriteContext) bool
func StampCookMeasure ¶
func StampCookMeasure(value *Stamp, context ...TableWriteContext) int64
func StampCookMeasureReason ¶
func StampCookMeasureReason(value *Stamp, context ...TableWriteContext) (int64, error)
func StampFromJson ¶
func StampFromJson(builder *StampBuilder, text []byte, report *TableReport) bool
func StampLoadBody ¶
func StampLoadBody(r *TableReader, value *Stamp) bool
func StampLoadBodyRetain ¶
func StampLoadBodyRetain(r *TableRetainReader, value *Stamp) bool
func StampLoadBuilder ¶
func StampLoadBuilder(b *StampBuilder, wire []byte, report *TableReport) bool
func StampLoadMeasure ¶
func StampLoadMeasureReason ¶
func StampLoadMessageBody ¶
func StampLoadMessageBody(r *TableMessageReader, value *Stamp) bool
func StampLoadMessageBodyRetain ¶
func StampLoadMessageBodyRetain(r *TableRetainMessageReader, value *Stamp) bool
func StampMeasure ¶
func StampMeasure(value *Stamp, context ...TableWriteContext) int64
func StampMeasureBody ¶
func StampMeasureBodyRetain ¶
func StampMeasureBodyRetain(value *Stamp, ids *TableRetainIds) int64
func StampMeasureReason ¶
func StampMeasureReason(value *Stamp, context ...TableWriteContext) (int64, error)
func StampMeasureRetain ¶
func StampMeasureRetain(value *Stamp, retain *TableRetain, allocator ...TableAllocator) int64
func StampReset ¶
func StampReset(value *Stamp)
StampReset restores Stamp's declared defaults in place, reusing the storage the value already holds. The reader calls it before overlaying.
func StampSaveBody ¶
func StampSaveBody(w *TableWriter, value *Stamp) bool
func StampSaveBodyFields ¶
func StampSaveBodyFields(w *TableWriter, value *Stamp) bool
func StampSaveBodyFieldsRetain ¶
func StampSaveBodyFieldsRetain(w *TableRetainWriter, value *Stamp) bool
func StampSaveBodyRetain ¶
func StampSaveBodyRetain(w *TableRetainWriter, value *Stamp) bool
func StampSaveMessageBody ¶
func StampSaveMessageBody(w *TableMessageWriter, value *Stamp) bool
func StampSaveRetain ¶
func StampSaveRetain(value *Stamp, retain *TableRetain, buffer []byte, report *TableReport, allocator ...TableAllocator) int64
func StampSaveText ¶
func StampSaveText(value *Stamp, context ...TableWriteContext) (string, error)
StampSaveText returns the base64 of Stamp'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 StampSave takes.
func StampToJson ¶
func StampToJson(value *Stamp, buffer []byte, allocator ...TableAllocator) int64
func StampToJsonMeasure ¶
func StampToJsonMeasure(value *Stamp, 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 Ack ¶
type Ack = AckRow
func AckLoad ¶
func AckLoad(region, wire []byte, report *TableReport) *Ack
func AckLoadRetain ¶
func AckLoadRetain(region, wire []byte, retain *TableRetain, report *TableReport) *Ack
func AckLoadText ¶
func AckLoadText(text string, report *TableReport) (*Ack, error)
AckLoadText reads one Ack 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 AckReadStrict 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 AckReadStrict ¶
AckReadStrict is the STRICT read (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5): one call, its own builder, one typed reason.
type AckBuilder ¶
type AckBuilder struct {
Arena TableArena
Main TableWorker
// contains filtered or unexported fields
}
func (*AckBuilder) AsConst ¶
func (b *AckBuilder) AsConst() *Ack
func (*AckBuilder) GetRoot ¶
func (b *AckBuilder) GetRoot() *Ack
func (*AckBuilder) Init ¶
func (b *AckBuilder) Init(allocator ...TableAllocator) bool
func (*AckBuilder) Lock ¶
func (b *AckBuilder) Lock() bool
func (*AckBuilder) PackMeasure ¶
func (b *AckBuilder) PackMeasure() int64
func (*AckBuilder) PackMeasureReason ¶
func (b *AckBuilder) PackMeasureReason() (int64, error)
func (*AckBuilder) Region ¶
func (b *AckBuilder) Region() []byte
func (*AckBuilder) Shutdown ¶
func (b *AckBuilder) Shutdown()
type AckCook ¶
type AckCook struct {
Region unsafe.Pointer // the DATA part's base: the root sits at offset zero
RegionLength int64 // data_length, as the header framed it
}
AckCook is Ack'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 — AckOpen, AckAt — 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 (*AckCook) 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 (AckCook) 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 (AckCook) 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 (AckCook) Type ¶
func (c AckCook) Type() *TableCookInfo
Type is Ack's cooked-record descriptor, the head of the graph a reflective walk follows (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type AckRow ¶
type AckRow struct {
Id [65]byte // string(64): buffer, used length beside it
IdLength int32
Stage Stage
Push PushState
Reason [153]byte // string(152): buffer, used length beside it
ReasonLength int32
// contains filtered or unexported fields
}
AckRow — 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 AckAt ¶
func AckAt(slot *int64, arena ...*TableArena) *AckRow
AckAt 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 Beat ¶
type Beat = BeatRow
func BeatLoad ¶
func BeatLoad(region, wire []byte, report *TableReport) *Beat
func BeatLoadRetain ¶
func BeatLoadRetain(region, wire []byte, retain *TableRetain, report *TableReport) *Beat
func BeatLoadText ¶
func BeatLoadText(text string, report *TableReport) (*Beat, error)
BeatLoadText reads one Beat 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 BeatReadStrict 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 BeatReadStrict ¶
BeatReadStrict is the STRICT read (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5): one call, its own builder, one typed reason.
type BeatBuilder ¶
type BeatBuilder struct {
Arena TableArena
Main TableWorker
// contains filtered or unexported fields
}
func (*BeatBuilder) AsConst ¶
func (b *BeatBuilder) AsConst() *Beat
func (*BeatBuilder) GetRoot ¶
func (b *BeatBuilder) GetRoot() *Beat
func (*BeatBuilder) Init ¶
func (b *BeatBuilder) Init(allocator ...TableAllocator) bool
func (*BeatBuilder) Lock ¶
func (b *BeatBuilder) Lock() bool
func (*BeatBuilder) PackMeasure ¶
func (b *BeatBuilder) PackMeasure() int64
func (*BeatBuilder) PackMeasureReason ¶
func (b *BeatBuilder) PackMeasureReason() (int64, error)
func (*BeatBuilder) Region ¶
func (b *BeatBuilder) Region() []byte
func (*BeatBuilder) Shutdown ¶
func (b *BeatBuilder) Shutdown()
type BeatCook ¶
type BeatCook struct {
Region unsafe.Pointer // the DATA part's base: the root sits at offset zero
RegionLength int64 // data_length, as the header framed it
}
BeatCook is Beat'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 — BeatOpen, BeatAt — 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 (*BeatCook) 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 (BeatCook) 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 (BeatCook) 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 (BeatCook) Type ¶
func (c BeatCook) Type() *TableCookInfo
Type is Beat's cooked-record descriptor, the head of the graph a reflective walk follows (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type BeatRow ¶
type BeatRow struct {
FriendName [65]byte // string(64): buffer, used length beside it
FriendNameLength int32
SentMs int64
SentMsPresent bool // ?: one byte, in Go's model as in C++
ActiveMs int64
ActiveMsPresent bool // ?: one byte, in Go's model as in C++
UntilMs int64
UntilMsPresent bool // ?: one byte, in Go's model as in C++
Reason [201]byte // string(200): buffer, used length beside it
ReasonLength int32
StopReturns uint32
StopReturnsPresent bool // ?: one byte, in Go's model as in C++
// contains filtered or unexported fields
}
BeatRow — 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 BeatAt ¶
func BeatAt(slot *int64, arena ...*TableArena) *BeatRow
BeatAt 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 PushState ¶
type PushState uint8
PushState — None = 0 implicit, variants dense from 1, wire range [0, 3] (SPEC §4.2)
func (PushState) TableEnumId ¶
TableEnumId: PushState 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 (*PushState) TableEnumValue ¶
TableEnumValue resolves a table-wire variant id to a PushState, 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 Stage ¶
type Stage uint8
Stage — None = 0 implicit, variants dense from 1, wire range [0, 4] (SPEC §4.2)
func (Stage) TableEnumId ¶
TableEnumId: Stage 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 (*Stage) TableEnumValue ¶
TableEnumValue resolves a table-wire variant id to a Stage, 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 Stamp ¶
type Stamp = StampRow
func StampLoad ¶
func StampLoad(region, wire []byte, report *TableReport) *Stamp
func StampLoadRetain ¶
func StampLoadRetain(region, wire []byte, retain *TableRetain, report *TableReport) *Stamp
func StampLoadText ¶
func StampLoadText(text string, report *TableReport) (*Stamp, error)
StampLoadText reads one Stamp 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 StampReadStrict 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 StampReadStrict ¶
StampReadStrict is the STRICT read (mas-bandwidth/schema docs/SPEC-TABLES.md §6.5): one call, its own builder, one typed reason.
type StampBuilder ¶
type StampBuilder struct {
Arena TableArena
Main TableWorker
// contains filtered or unexported fields
}
func (*StampBuilder) AsConst ¶
func (b *StampBuilder) AsConst() *Stamp
func (*StampBuilder) GetRoot ¶
func (b *StampBuilder) GetRoot() *Stamp
func (*StampBuilder) Init ¶
func (b *StampBuilder) Init(allocator ...TableAllocator) bool
func (*StampBuilder) Lock ¶
func (b *StampBuilder) Lock() bool
func (*StampBuilder) PackMeasure ¶
func (b *StampBuilder) PackMeasure() int64
func (*StampBuilder) PackMeasureReason ¶
func (b *StampBuilder) PackMeasureReason() (int64, error)
func (*StampBuilder) Region ¶
func (b *StampBuilder) Region() []byte
func (*StampBuilder) Shutdown ¶
func (b *StampBuilder) Shutdown()
type StampCook ¶
type StampCook struct {
Region unsafe.Pointer // the DATA part's base: the root sits at offset zero
RegionLength int64 // data_length, as the header framed it
}
StampCook is Stamp'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 — StampOpen, StampAt — 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 (*StampCook) 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 (StampCook) 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 (StampCook) 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 (StampCook) Type ¶
func (c StampCook) Type() *TableCookInfo
Type is Stamp's cooked-record descriptor, the head of the graph a reflective walk follows (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
type StampRow ¶
type StampRow struct {
Epoch int64
EpochPresent bool // ?: one byte, in Go's model as in C++
AtMs int64
AtMsPresent bool // ?: one byte, in Go's model as in C++
By [129]byte // string(128): buffer, used length beside it
ByLength int32
// contains filtered or unexported fields
}
StampRow — 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 StampAt ¶
func StampAt(slot *int64, arena ...*TableArena) *StampRow
StampAt 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 AckTableInfo TableTypeInfo
AckTableInfo is Ack's reflection descriptor (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var BeatTableInfo TableTypeInfo
BeatTableInfo is Beat's reflection descriptor (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
var StampTableInfo TableTypeInfo
StampTableInfo is Stamp's reflection descriptor (mas-bandwidth/schema docs/SPEC-TABLES.md §8).
func AckTableType ¶
func AckTableType() *TableTypeInfo
AckTableType returns Ack's reflection descriptor.
func BeatTableType ¶
func BeatTableType() *TableTypeInfo
BeatTableType returns Beat's reflection descriptor.
func StampTableType ¶
func StampTableType() *TableTypeInfo
StampTableType returns Stamp'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
|
|
|
hook-driver
command
Command hook-driver is the Go leg the schema compiler's wire fuzzer drives over the hook unit (make schemawire-conformance): its three roots, the Ack, the Beat and the Stamp.
|
Command hook-driver is the Go leg the schema compiler's wire fuzzer drives over the hook unit (make schemawire-conformance): its three roots, the Ack, the Beat and the Stamp. |