1 // Generated by the gRPC-dlang plugin. 2 3 module app.grpc.AuthServiceRpc; 4 5 import app.grpc.AuthService; 6 import app.grpc.message.Common; 7 import app.grpc.message.AuthorizeMsg; 8 import app.grpc.message.LoginMsg; 9 10 import grpc; 11 import google.protobuf; 12 import hunt.logging; 13 14 import core.thread; 15 import std.array; 16 import std.traits; 17 18 19 /** 20 * 21 */ 22 class AuthServiceClient 23 { 24 this(Channel channel) 25 { 26 _channel = channel; 27 } 28 29 LoginMsg authorize(AuthorizeMsg request) 30 { 31 mixin(CM!(LoginMsg, AuthServiceBase.SERVICE)); 32 } 33 34 void authorize(AuthorizeMsg request , void delegate(Status status, LoginMsg response) dele) 35 { 36 mixin(CMA!(LoginMsg, AuthServiceBase.SERVICE)); 37 } 38 39 40 private: 41 Channel _channel; 42 } 43 44 45 /** 46 * 47 */ 48 class AuthServiceBase: GrpcService 49 { 50 enum SERVICE = "app.grpc.AuthService"; 51 string getModule() 52 { 53 return SERVICE; 54 } 55 56 Status authorize(AuthorizeMsg req, ref LoginMsg res){ return Status.OK; } 57 58 Status process(string method, GrpcStream stream, ubyte[] complete) 59 { 60 switch(method) 61 { 62 mixin(SM!(AuthorizeMsg, LoginMsg , "authorize")); 63 mixin(NONE()); 64 } 65 } 66 } 67 68