Documentation
¶
Index ¶
- Constants
- Variables
- func InnerLabel(v zapv1.View[InnerSchema]) string
- func NewInner(iD uint64, label string) (zapv1.View[InnerSchema], []byte)
- func NewOuter(seq uint64, inner *Inner) (zapv1.View[OuterSchema], []byte)
- func OuterInner(v zapv1.View[OuterSchema]) zapv1.View[InnerSchema]
- func WrapInner(b []byte) (zapv1.View[InnerSchema], error)
- func WrapOuter(b []byte) (zapv1.View[OuterSchema], error)
- type Inner
- type InnerSchema
- type OuterSchema
Constants ¶
const KindInner zapv1.KindByte = 0x52
KindInner is the wire discriminator for Inner.
const KindOuter zapv1.KindByte = 0x51
KindOuter is the wire discriminator for Outer.
const OffsetInner_ID = 0
OffsetInner_ID is the byte offset of the ID field.
const OffsetInner_Label = 8
OffsetInner_Label is the byte offset of the Label field.
const OffsetOuter_Inner = 9
OffsetOuter_Inner is the byte offset of the Inner field.
const OffsetOuter_Seq = 1
OffsetOuter_Seq is the byte offset of the Seq field.
const SizeInner = 16
SizeInner is the fixed object payload size in bytes.
const SizeOuter = 13
SizeOuter is the fixed object payload size in bytes.
Variables ¶
var InnerSchemaFields = struct { ID zapv1.Field[InnerSchema, uint64] }{ ID: zapv1.At[InnerSchema, uint64](0), }
InnerSchemaFields is the namespace of every scalar field accessor for Inner. Use with zapv1.Read / zapv1.Write for type-safe access. Byte-array fields are emitted as standalone functions, see below.
var OuterSchemaFields = struct { Seq zapv1.Field[OuterSchema, uint64] }{ Seq: zapv1.At[OuterSchema, uint64](1), }
OuterSchemaFields is the namespace of every scalar field accessor for Outer. Use with zapv1.Read / zapv1.Write for type-safe access. Byte-array fields are emitted as standalone functions, see below.
Functions ¶
func InnerLabel ¶
func InnerLabel(v zapv1.View[InnerSchema]) string
InnerLabel reads the variable-length Label string field of Inner.
Zero-copy: v1's Object.Text returns a string over a sub-slice of the underlying buffer. Valid only while the View's buffer is alive.
func NewInner ¶
NewInner builds a fresh Inner in a ZAP buffer.
Hand-rolled fast path: inlines v1 primitives (zap.NewBuilder, [*Builder.StartObject], [*ObjectBuilder.Set*], [*Builder.Finish]) so the entire build expands at the call site. Scalars and fixed byte arrays live in the fixed payload; variable-length string/bytes go in the object tail (the fixed payload holds their 8-byte pointers).
func NewOuter ¶
NewOuter builds a fresh Outer in a ZAP buffer.
Hand-rolled fast path: inlines v1 primitives (zap.NewBuilder, [*Builder.StartObject], [*ObjectBuilder.Set*], [*Builder.Finish]) so the entire build expands at the call site. Scalars and fixed byte arrays live in the fixed payload; variable-length string/bytes go in the object tail (the fixed payload holds their 8-byte pointers).
func OuterInner ¶
func OuterInner(v zapv1.View[OuterSchema]) zapv1.View[InnerSchema]
OuterInner returns the singular Inner nested object of Outer as a zero-copy zapv1.ViewInnerSchema. An unset (null) nested field yields the zero View — test it with zapv1.View.IsZero.
func WrapInner ¶
func WrapInner(b []byte) (zapv1.View[InnerSchema], error)
WrapInner parses a ZAP buffer into a typed [zapv1.View[Inner]]. Validates the wire frame and the kind discriminator at offset 0; returns *zapv1.SchemaError on kind mismatch.
Hand-rolled fast path: inlines zap.Parse (which is itself inlineable). Zero heap allocs on the happy path; matches v1 hand-rolled performance.
func WrapOuter ¶
func WrapOuter(b []byte) (zapv1.View[OuterSchema], error)
WrapOuter parses a ZAP buffer into a typed [zapv1.View[Outer]]. Validates the wire frame and the kind discriminator at offset 0; returns *zapv1.SchemaError on kind mismatch.
Hand-rolled fast path: inlines zap.Parse (which is itself inlineable). Zero heap allocs on the happy path; matches v1 hand-rolled performance.
Types ¶
type InnerSchema ¶
type InnerSchema struct{}
InnerSchema is the v1 schema marker for Inner. Methods are constant- returning so concrete-typed [zapv1.Wrap[InnerSchema]] calls fold to literals at the call site.
func (InnerSchema) Kind ¶
func (InnerSchema) Kind() zapv1.KindByte
func (InnerSchema) Name ¶
func (InnerSchema) Name() string
func (InnerSchema) Size ¶
func (InnerSchema) Size() int
type OuterSchema ¶
type OuterSchema struct{}
OuterSchema is the v1 schema marker for Outer. Methods are constant- returning so concrete-typed [zapv1.Wrap[OuterSchema]] calls fold to literals at the call site.
func (OuterSchema) Kind ¶
func (OuterSchema) Kind() zapv1.KindByte
func (OuterSchema) Name ¶
func (OuterSchema) Name() string
func (OuterSchema) Size ¶
func (OuterSchema) Size() int