Documentation
¶
Overview ¶
Package kitchen is a wire schema that uses every feature the generators support. The conformance test encodes values in Go and checks that the generated Swift and Java decode and re-encode them byte for byte.
Index ¶
Constants ¶
const SchemaHash uint64 = 0x7315bd8da448f253
SchemaHash identifies this schema's wire layout. Hosts pass it (combined with any other schemas) to nn_start, which refuses a mismatch.
Variables ¶
This section is empty.
Functions ¶
func AppendMessage ¶
AppendMessage appends a Message: its variant index (0 for nil), then the variant.
Types ¶
type Batch ¶
Batch is a list of ops — the shape of a UI commit.
func (*Batch) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Collections ¶
type Collections struct {
Names []string
Matrix [][]int32
Scores map[string]float64
ByID map[uint64]string
Signed map[int32]bool
Nested map[string][]uint16
MaybeU32 *uint32
MaybeS *string
MaybeF *float64
Kinds []Kind
MaybeK *Kind
Level Level
}
Collections covers lists, maps and optionals, nested.
func (*Collections) AppendWire ¶
func (m *Collections) AppendWire(b []byte) []byte
AppendWire appends m's wire encoding to b.
func (*Collections) ReadWire ¶
func (m *Collections) ReadWire(r *wire.Reader)
ReadWire decodes m from r. Check r.Err() afterwards.
type Create ¶
Create adds a node.
func (*Create) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Kind ¶
type Kind uint8
Kind is a small enum; values outside the list must survive a round trip.
type Message ¶
type Message interface {
// contains filtered or unexported methods
}
Message is any top-level message in this schema.
func ReadMessage ¶
ReadMessage decodes a Message (nil for index 0).
type Meta ¶
Meta is a plain nested struct.
func (*Meta) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Node ¶
type Node struct {
ID uint32
Kind Kind
Label string
Props map[string]string
Children []*Node
Meta *Meta
Default string // a Swift keyword as a field name
W float32 // shares its name with generated code's writer
}
Node is a recursive tree, the shape a UI tree will have.
func (*Node) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Op ¶
type Op interface {
// contains filtered or unexported methods
}
Op is a union: one of several structs.
type Remove ¶
type Remove struct {
ID uint32
}
Remove deletes a node.
func (*Remove) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Scalars ¶
type Scalars struct {
B bool
U8 uint8
U16 uint16
U32 uint32
U64 uint64
I8 int8
I16 int16
I32 int32
I64 int64
I int
U uint
F32 float32
F64 float64
S string
Raw []byte
}
Scalars covers every scalar type at the edges of its range.
func (*Scalars) AppendWire ¶
AppendWire appends m's wire encoding to b.