Protein v0.7.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

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.

Attaches a service to the client module with a customized config.

Options

  • proto: options passed to Protobuf, usually [from: "some/proto/file.proto"]
  • service_name: string identifier of the service; defaults to proto file’s root name
  • proto_mod: base module that hosts the proto structures; defaults to camelized service name nested in the client/server module
  • request_mod: request struct module; defaults to Request structure nested in proto_mod module
  • response_mod: response struct module; defaults to Response structure nested in proto_mod
  • service_mod: mock module; defaults to proto_mod suffixed with Service
  • mock_mod: mock module; defaults to proto_mod suffixed with Mock
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.