54 releases (19 breaking)

new 0.20.0 Dec 3, 2024
0.19.0 Nov 25, 2024
0.18.0 Oct 22, 2024
0.16.5 Jul 10, 2024
0.1.4 Jul 28, 2020

#650 in Rust patterns

Download history 1279/week @ 2024-08-17 1238/week @ 2024-08-24 1105/week @ 2024-08-31 1336/week @ 2024-09-07 1203/week @ 2024-09-14 1673/week @ 2024-09-21 1654/week @ 2024-09-28 1383/week @ 2024-10-05 1317/week @ 2024-10-12 1261/week @ 2024-10-19 1255/week @ 2024-10-26 1171/week @ 2024-11-02 1384/week @ 2024-11-09 855/week @ 2024-11-16 999/week @ 2024-11-23 1123/week @ 2024-11-30

4,617 downloads per month
Used in prima-tracing

MIT license

105KB
2K SLoC

Build Status

bridge.rs

Prima bridge pattern implementation for rust

Api documentation

Examples

You can find all the examples in examples directory.


lib.rs:

This crate gives a high level API to execute external HTTP requests.

It is supposed to give the basics building blocks for building bridges to other services while abstracting the low level stuff like adding custom headers and request tracing.

It supports both REST and GraphQL requests.

You should start by creating a [Bridge] instance. This instance should live for all the application lifetime.

Do not create a new bridge on every request!

You should use something like once_cell or lazy_static, or some sort of inversion of control container to pass around.

The bridge implement a type state pattern to build the external request.

Features

  • auth0 - enable auth0 integration, allowing bridge.rs to retrieve tokens from auth0 for authentication
  • gzip - provides response body gzip decompression.
  • redis-tls - add support for connecting to redis with tls
  • grpc - provides the [GrpcOtelInterceptor] for adding the opentelemetry context to the gRPC requests
  • tracing_opentelemetry - adds support for integration with opentelemetry. This feature is an alias for the latest tracing_opentelemetry_x_xx feature.
  • tracing_opentelemetry_x_xx (e.g. tracing_opentelemetry_0_27) - adds support for integration with a particular opentelemetry version. We are going to support at least the last 3 versions of opentelemetry. After that we might remove support for older otel version without it being a breaking change.

Dependencies

~7–23MB
~356K SLoC