1 module example.api.examplerpc; 2 3 4 // Generated by the gRPC dlang plugin. 5 6 7 import example.api.example; 8 import std.array; 9 import grpc; 10 import google.protobuf; 11 import hunt.logging; 12 import core.thread; 13 14 15 16 17 class HelloClient 18 { 19 this(Channel channel) 20 { 21 _channel = channel; 22 } 23 24 HelloResponse sayHello( HelloRequest request) 25 { 26 mixin(CM!(HelloResponse , HelloBase.SERVICE)); 27 } 28 29 void sayHello( HelloRequest request , void delegate(Status status , HelloResponse response) dele) 30 { 31 mixin(CMA!(HelloResponse , HelloBase.SERVICE)); 32 } 33 34 35 private: 36 Channel _channel; 37 } 38 39 class HelloBase: GrpcService 40 { 41 enum SERVICE = "example.api.Hello"; 42 string getModule() 43 { 44 return SERVICE; 45 } 46 47 Status sayHello(HelloRequest , ref HelloResponse){ return Status.OK; } 48 49 Status process(string method , GrpcStream stream) 50 { 51 switch(method) 52 { 53 mixin(SM!(HelloRequest , HelloResponse , "sayHello")); 54 mixin(NONE()); 55 } 56 } 57 } 58 59