53 releases (18 breaking)

new 0.19.0 Nov 25, 2024
0.17.0 Sep 27, 2024
0.16.5 Jul 10, 2024
0.16.0 Mar 11, 2024
0.1.4 Jul 28, 2020

#614 in Rust patterns

Download history 1009/week @ 2024-08-04 1025/week @ 2024-08-11 1304/week @ 2024-08-18 1216/week @ 2024-08-25 1107/week @ 2024-09-01 1336/week @ 2024-09-08 1199/week @ 2024-09-15 1699/week @ 2024-09-22 1637/week @ 2024-09-29 1388/week @ 2024-10-06 1303/week @ 2024-10-13 1272/week @ 2024-10-20 1257/week @ 2024-10-27 1158/week @ 2024-11-03 1403/week @ 2024-11-10 834/week @ 2024-11-17

4,669 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 an 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

  • tracing-opentelemetry adds support for integration with opentelemetry. This feature is an alias for the tracing_opentelemetry_0_21 feature. tracing_opentelemetry_0_20 is also available as to support the 0.20 opentelemetry libraries.

    We are going to support at least the last 3 versions of opentelemetry. After that we mightremove support for older otel version without it being a breaking change.

Dependencies

~7–23MB
~353K SLoC