mirror of
https://github.com/zap-proto/scala.git
synced 2026-10-30 15:03:46 +00:00
- package org.katis.capnproto -> org.katis.zap (7 dirs, all sources) - .capnp/.capnp.scala -> .zap/.zap.scala (14 files) - compiler binary capnpc -> zapc; external tool 'capnp compile' -> 'zap compile' - CapnProtoExts -> ZapExts; codegen header 'CAP'\''N PROTO' -> 'ZAP' - build.sbt name/project/mainClass rebranded; Scala.js artifact cap-n-proto-example -> zap-example - resolve case-collision: drop capnproto Readme.md, keep ZAP README.md (removes capnproto.org refs) - Sandstorm MIT copyright header retained (legal attribution, no capnp token)
37 lines
588 B
Plaintext
37 lines
588 B
Plaintext
using Scala = import "../scala.zap";
|
|
|
|
@0xbba67e30383fe749;
|
|
$Scala.package("org.katis.zap.example");
|
|
$Scala.module("todo");
|
|
|
|
struct ClientMessage {
|
|
union {
|
|
initial :group {
|
|
clientId @0 :UInt64;
|
|
todos @1 :List(Todo);
|
|
}
|
|
added @2 :Todo;
|
|
removed @3 :Todo;
|
|
modified @4 :Todo;
|
|
|
|
addFailed @5 :Todo;
|
|
removalFailed @6 :Todo;
|
|
modifyFailed @7 :Todo;
|
|
}
|
|
}
|
|
|
|
struct ServerMessage {
|
|
clientId @0 :UInt64;
|
|
union {
|
|
add @1 :Todo;
|
|
remove @2 :Todo;
|
|
modify @3 :Todo;
|
|
}
|
|
}
|
|
|
|
struct Todo {
|
|
id @0 :UInt64;
|
|
contents @1 :Text;
|
|
created @2 :Text;
|
|
}
|