Calling dependencies

Calling the services a humus service depends on: HTTP services with the httpclient package, then gRPC services with the grpcclient package.

A service calls each of its dependencies with a client it builds in Init. These pages cover the two clients humus has, in this order: HTTP services with httpclient, then gRPC services with grpcclient. Both retry what is safe to retry, put a circuit breaker in front of each dependency, and let the end user’s Classify decide what an answer means.


Calling HTTP services

How to call HTTP dependencies with the httpclient package: one client per dependency, built in Init from httpclient.Settings sourced with config.Struct, TLS and plain text, which requests are retried and how the end user’s Classify decides what an answer means, Retry-After and the timeouts, the circuit breaker and its log records, the body rules, HTTP/2 behind a Kubernetes Service, what it records, and how to test the calls against a fake dependency.

Calling gRPC services

How to call gRPC dependencies with the grpcclient package: one Client per dependency, built in Init from grpcclient.Settings sourced with config.Struct, TLS and plain text, names and addresses behind a ClusterIP or a headless Service and spreading load with the server’s MaxConnectionAge, which calls are retried and how the end user’s Classify decides what a code means, the pushback, the circuit breaker and its log records, streams, what it records, readiness with Connected, and how to test the end user’s whole App next to a grpcserver backend.