~bduggan/raku-protobuf

ref: 204a01ffb6bd0849698e8adf47a3b1bc4030f020 raku-protobuf/script/protoc.raku -rwxr-xr-x 520 bytes
204a01ffBrian Duggan doc 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env raku

use Protobuf;

my $p = parse-proto($*ARGFILES.slurp);

for $p.services -> $svc {
  say "service name " ~ $svc.name;
  for $svc.endpoints -> $e {
    say " endpoint  " ~ $e.name;
    say '  request params ' ~ $e.request.name;
    for $e.request.fields -> $f {
      say '   name : ' ~ $f.name;
      say '   type : ' ~ $f.type;
    }
    say '  response params ' ~ $e.response.name;
    for $e.response.fields -> $f {
      say '   name : ' ~ $f.name;
      say '   type : ' ~ $f.type;
    }
  }
}