Documentation
¶
Overview ¶
Package proto is the hello app's wire schema: every message between its Go code and its iOS / Android hosts. `nimbus native gen` (run by every build) generates wire_gen.go here and the Swift / Java types.
Index ¶
- Constants
- func AppendMessage(b []byte, v Message) []byte
- func Encode(m Message) []byte
- type Ack
- type Crash
- type Echo
- type Greeting
- type Hello
- type Item
- type Kind
- type Message
- type Ping
- type Pong
- type Ready
- type Row
- type Snapshot
- type SnapshotRequest
- type StartBurst
- type Stats
- type StatsRequest
- type Tick
Constants ¶
const SchemaHash uint64 = 0x419f25d7cbd57b3f
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 Ack ¶
type Ack struct{ OK bool }
func (*Ack) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Crash ¶
type Crash struct{ Reason string }
Crash makes the Go handler panic, to check panic reporting.
func (*Crash) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Echo ¶
type Echo struct{ Text string }
Echo comes back unchanged (sync call; used for call benchmarks).
func (*Echo) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Greeting ¶
type Greeting struct{ Text, GoVersion, Platform string }
Greeting answers Hello.
func (*Greeting) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Hello ¶
type Hello struct{ Name string }
Hello asks Go to greet someone (sync call).
func (*Hello) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Item ¶
type Item struct{ Index uint32 }
func (*Item) AppendWire ¶
AppendWire appends m's wire encoding to b.
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 Ping ¶
type Ping struct{ Seq uint32 }
func (*Ping) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Pong ¶
type Pong struct{ Seq uint32 }
func (*Pong) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Ready ¶
type Ready struct{ GoVersion string }
Ready is the first message Go sends after start.
func (*Ready) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Row ¶
type Row struct {
ID uint32
Title string
Subtitle *string
Kind Kind
Score float64
Tags []string
Attrs map[string]string
}
Row is one list item: the kind of data a UI batch carries.
func (*Row) AppendWire ¶
AppendWire appends m's wire encoding to b.
type Snapshot ¶
type Snapshot struct{ Rows []Row }
func (*Snapshot) AppendWire ¶
AppendWire appends m's wire encoding to b.
type SnapshotRequest ¶
type SnapshotRequest struct{ Rows uint32 }
SnapshotRequest asks for a list shaped like real screen data.
func (*SnapshotRequest) AppendWire ¶
func (m *SnapshotRequest) AppendWire(b []byte) []byte
AppendWire appends m's wire encoding to b.
func (*SnapshotRequest) ReadWire ¶
func (m *SnapshotRequest) ReadWire(r *wire.Reader)
ReadWire decodes m from r. Check r.Err() afterwards.
type StartBurst ¶
type StartBurst struct{ Count uint32 }
StartBurst makes Go send Count Items as fast as it can.
func (*StartBurst) AppendWire ¶
func (m *StartBurst) AppendWire(b []byte) []byte
AppendWire appends m's wire encoding to b.
func (*StartBurst) ReadWire ¶
func (m *StartBurst) ReadWire(r *wire.Reader)
ReadWire decodes m from r. Check r.Err() afterwards.
type Stats ¶
Stats is bridge traffic and Go memory (bridge.ReadStats).
func (*Stats) AppendWire ¶
AppendWire appends m's wire encoding to b.
type StatsRequest ¶
type StatsRequest struct{ GC bool }
func (*StatsRequest) AppendWire ¶
func (m *StatsRequest) AppendWire(b []byte) []byte
AppendWire appends m's wire encoding to b.
func (*StatsRequest) ReadWire ¶
func (m *StatsRequest) ReadWire(r *wire.Reader)
ReadWire decodes m from r. Check r.Err() afterwards.
type Tick ¶
type Tick struct{ N uint32 }
Tick is sent from a goroutine the host never created.
func (*Tick) AppendWire ¶
AppendWire appends m's wire encoding to b.