| // Copyright 2020 The Fuchsia 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 fuchsia.examples; |
| |
| // [START max] |
| const MAX_STRING_LENGTH uint64 = 32; |
| // [END max] |
| |
| // [START echo] |
| @discoverable |
| protocol Echo { |
| EchoString(struct { |
| value string:MAX_STRING_LENGTH; |
| }) -> (struct { |
| response string:MAX_STRING_LENGTH; |
| }); |
| SendString(struct { |
| value string:MAX_STRING_LENGTH; |
| }); |
| -> OnString(struct { |
| response string:MAX_STRING_LENGTH; |
| }); |
| }; |
| // [END echo] |
| |
| // [START launcher] |
| @discoverable |
| protocol EchoLauncher { |
| GetEcho(struct { |
| echo_prefix string:MAX_STRING_LENGTH; |
| }) -> (resource struct { |
| response client_end:Echo; |
| }); |
| GetEchoPipelined(resource struct { |
| echo_prefix string:MAX_STRING_LENGTH; |
| request server_end:Echo; |
| }); |
| }; |
| // [END launcher] |
| |
| service EchoService { |
| regular_echo client_end:Echo; |
| reversed_echo client_end:Echo; |
| }; |