-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
This proto:
syntax = "proto3";
package mainflux;
service ThingsService {
rpc CanAccess(AccessReq) returns (ThingID) {}
rpc Identify(Token) returns (ThingID) {}
}
service UsersService {
rpc Identify(Token) returns (UserID) {}
}
message AccessReq {
string token = 1;
uint64 chanID = 2;
}
message ThingID {
uint64 value = 1;
}
message Token {
string value = 1;
}
message UserID {
string value = 1;
}
Results in the following code:
-module(internal_client).
%% this file was generated by grpc
-export(['CanAccess'/3,
'Identify'/3,
'Identify'/3]).
-type 'AccessReq'() ::
#{token => string(),
chanID => integer()}.
-type 'ThingID'() ::
#{value => integer()}.
-type 'Token'() ::
#{value => string()}.
-type 'UserID'() ::
#{value => string()}.
-export_type(['AccessReq'/0,
'ThingID'/0,
'Token'/0,
'UserID'/0]).
-spec decoder() -> module().
%% The module (generated by gpb) used to encode and decode protobuf
%% messages.
decoder() -> internal.
%% RPCs for service 'ThingsService'
-spec 'CanAccess'(
Connection::grpc_client:connection(),
Message::'AccessReq'(),
Options::[grpc_client:stream_option() |
{timeout, timeout()}]) ->
grpc_client:unary_response('ThingID'()).
%% This is a unary RPC
'CanAccess'(Connection, Message, Options) ->
grpc_client:unary(Connection, Message,
'ThingsService', 'CanAccess',
decoder(), Options).
-spec 'Identify'(
Connection::grpc_client:connection(),
Message::'Token'(),
Options::[grpc_client:stream_option() |
{timeout, timeout()}]) ->
grpc_client:unary_response('ThingID'()).
%% This is a unary RPC
'Identify'(Connection, Message, Options) ->
grpc_client:unary(Connection, Message,
'ThingsService', 'Identify',
decoder(), Options).
%% RPCs for service 'UsersService'
-spec 'Identify'(
Connection::grpc_client:connection(),
Message::'Token'(),
Options::[grpc_client:stream_option() |
{timeout, timeout()}]) ->
grpc_client:unary_response('UserID'()).
%% This is a unary RPC
'Identify'(Connection, Message, Options) ->
grpc_client:unary(Connection, Message,
'UsersService', 'Identify',
decoder(), Options).
This Erlang code does not compile because of duplicated Identify() function definition.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels