Commit Graph
10 Commits
Author SHA1 Message Date
Rene Nochebuena 007b1a68b1 release: v1.6.0 (coordinated lockstep bump) v1.6.0 2026-08-13 23:12:26 -06:00
Rene Nochebuena d47fb3e1d0 chore(httpclient): framework version alignment to v1.5.0 v1.5.0 2026-08-12 17:56:21 -06:00
Rene Nochebuena 63a9d309d3 chore(httpclient): dependency refresh; framework version alignment to v1.4.0 v1.4.0 2026-08-12 15:29:48 -06:00
Rene Nochebuena dfa13140d4 chore(httpclient): framework version alignment to v1.3.0 v1.3.0 2026-08-08 10:48:56 -06:00
Rene Nochebuena 3e09c55425 chore(httpclient): framework version alignment to v1.2.0 v1.2.0 2026-08-08 02:25:22 -06:00
Rene Nochebuena 508e5b3998 chore(httpclient): framework version alignment to v1.1.3 v1.1.3 2026-08-08 01:26:56 -06:00
Rene Nochebuena a143f4cf69 chore(httpclient): framework version alignment to v1.1.2 v1.1.2 2026-08-08 00:43:50 -06:00
Rene Nochebuena 32522fb616 chore(httpclient): framework version alignment to v1.1.1 v1.1.1 2026-08-07 23:32:49 -06:00
Rene Nochebuena 48c44aeb9a chore(httpclient): bump einherjar deps to v1.1.0 (framework version alignment) (#1)
Patch of the coordinated framework release: einherjar modules move to v1.1.0
in lockstep, so httpclient is bumped alongside the rest.

- go.mod: contracts, core -> v1.1.0 (via go get + go mod tidy)

No code or API changes. ModuleVersion() reports v1.1.0 automatically from
build info once tagged. Badge bumped to v1.1.0.

Reviewed-on: #1
Co-authored-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
Co-committed-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
v1.1.0
2026-08-07 19:13:08 -06:00
Rene Nochebuena caa397591e feat(httpclient): initial implementation — HTTP client with retry and circuit breaker (v1.0.0)
Introduces code.nochebuena.dev/einherjar/httpclient — the outbound HTTP client
starter for the Einherjar framework. Absorbs the httpclient package from micro-lib,
replacing fmt.Errorf wrapping with core/xerrors and adding generic JSON helpers.

Interfaces:
- Provider — Do(req *http.Request) (*http.Response, error)

Implementation:
- New(logger, cfg) Provider — configures net.Dialer + retry + circuit breaker
- NewWithDefaults(logger) Provider — convenience constructor with default config
- Retry: avast/retry-go; configurable MaxRetries and RetryDelay; retries on
  network errors and 5xx responses; logs each retry attempt at Warn level
- Circuit breaker: sony/gobreaker; opens after CBThreshold consecutive failures
  within CBTimeout window; returns ErrUnavailable when open
- DoJSON[T](ctx, client, req) (*T, error) — executes request, decodes JSON body
- DoJSONRequest[Req, Resp](ctx, client, method, rawURL, body) (*Resp, error) —
  marshals body, builds request, executes, decodes response
- MapStatusToError(code, msg) error — maps HTTP status codes to xerrors values

Config (EINHERJAR_HTTP_* env vars):
  Name(http), Timeout(30s), DialTimeout(5s),
  MaxRetries(3), RetryDelay(1s), CBThreshold(10), CBTimeout(1m)

- identifiable.go: package-level Module variable (observability.Identifiable) for version
  identification — httpclient is a stateless provider; not registered with the launcher
v1.0.0
2026-05-29 16:06:47 +00:00