Protein v0.16.0 Protein.RouterAPI View Source
Macros for defining a list of services and transport options.
Link to this section Summary
Functions
Attaches a service inferring its options from given proto name
Attaches a service to the client module with a customized config
Specifies a transport adapter for the RPC calls along with its options
Link to this section Functions
Link to this macro
proto(name) View Source (macro)
Attaches a service inferring its options from given proto name.
Supports either atom or binary name. Check out moduledoc for Protein.Client
for more info.
Link to this macro
service(opts) View Source (macro)
Attaches a service to the client module with a customized config.
Options
proto
: options passed toProtobuf
, usually[from: "some/proto/file.proto"]
service_name
: string identifier of the service; defaults to proto file's root nameproto_mod
: base module that hosts the proto structures; defaults to camelized service name nested in the client/server modulerequest_mod
: request struct module; defaults toRequest
structure nested inproto_mod
moduleresponse_mod
: response struct module; defaults toResponse
structure nested inproto_mod
service_mod
: mock module; defaults toproto_mod
suffixed withService
mock_mod
: mock module; defaults toproto_mod
suffixed withMock
Link to this macro
transport(adapter, adapter_opts \\ []) View Source (macro)
Specifies a transport adapter for the RPC calls along with its options.
The following adapters are supported:
You may also use your own adapter module by passing it as first argument.