Protein v0.20.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 toRequeststructure nested inproto_modmoduleresponse_mod: response struct module; defaults toResponsestructure nested inproto_modservice_mod: mock module; defaults toproto_modsuffixed withServicemock_mod: mock module; defaults toproto_modsuffixed 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.