| // Copyright 2018 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| library bindingstest; |
| |
| using zx; |
| |
| protocol Test1 { |
| Echo(struct { |
| in string:optional; |
| }) -> (struct { |
| out string:optional; |
| }); |
| NoResponse(); |
| EmptyResponse() -> (); |
| -> Surprise(struct { |
| foo string; |
| }); |
| EchoHandleRights(resource struct { |
| h zx.Handle:<PORT, zx.Rights.READ | zx.Rights.TRANSFER | zx.Rights.DUPLICATE>; |
| }) -> (struct { |
| rights uint32; |
| }); |
| }; |
| |
| protocol ExampleProtocol {}; |
| |
| type HasClientEnd = resource struct { |
| client_end client_end:ExampleProtocol; |
| }; |
| |
| type HasServerEnd = resource struct { |
| server_end server_end:ExampleProtocol; |
| }; |
| |
| type TestInterface1 = resource struct { |
| a client_end:Test1; |
| b client_end:<Test1, optional>; |
| c server_end:Test1; |
| d server_end:<Test1, optional>; |
| }; |
| |
| type SimpleTable = table { |
| 1: x int64; |
| 2: reserved; |
| 3: reserved; |
| 4: reserved; |
| 5: y int64; |
| }; |