Skip to content

refactor!: idiomatic API naming cleanup (BREAKING)#5

Merged
datariot merged 1 commit into
mainfrom
refactor/api-cleanup
Jul 7, 2026
Merged

refactor!: idiomatic API naming cleanup (BREAKING)#5
datariot merged 1 commit into
mainfrom
refactor/api-cleanup

Conversation

@datariot

@datariot datariot commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Pre-1.0 breaking API cleanup so the public surface is idiomatic before people adopt it. Mechanical + compiler-verified; full -race suite, lint 0, all 7 example modules build.

Breaking changes / migration

Get-prefix stripped from getters:

Old New
ObservabilityManager.GetTracer/GetMeter Tracer/Meter
Registry.GetRegisteredChecks/GetCheckConfig RegisteredChecks/CheckConfig
Report.GetHealthySummary HealthySummary
prometheus.Bundle.GetMetricsHandler/GetSecureMetricsHandler MetricsHandler/SecureMetricsHandler
configloader.Loader.GetConfigInfo ConfigInfo
httpclient.Client.GetCircuitBreakerState/GetCircuitBreakerCounts CircuitBreakerState/CircuitBreakerCounts
jwt.GetServiceID/GetServiceName jwt.ServiceID/ServiceName

CredentialProvider.GetAPIKey/GetJWTToken are kept — they're context-taking, error-returning fetch operations, not field accessors.

Stutter fix: health.HealthStatushealth.Report; constructors NewHealthyStatus/NewUnhealthyStatus/NewUnknownStatusNewHealthyReport/NewUnhealthyReport/NewUnknownReport. The Status enum, StatusResponse, CheckResult are unchanged.

Package rename: github.com/datariot/forge/errorsgithub.com/datariot/forge/forgeerrors (via git mv, history preserved). It no longer shadows stdlib errors, so the six bundles drop their stderrors aliasing workaround.

Modernization: interface{}any tree-wide.

All example modules and doc code samples updated to match. A follow-up docs pass will regenerate the API reference against these names.

🤖 Generated with Claude Code

…rt, errors->forgeerrors, interface{}->any)

Pre-1.0 breaking cleanup of API naming conventions across the framework.

BREAKING CHANGES / migration notes:
- Get* getters renamed to drop the redundant prefix (idiomatic Go):
  - framework.ObservabilityManager: GetTracer -> Tracer, GetMeter -> Meter
  - health.Registry: GetRegisteredChecks -> RegisteredChecks, GetCheckConfig -> CheckConfig
  - health.Report (fka HealthStatus): GetHealthySummary -> HealthySummary
  - bundles/prometheus.Bundle: GetMetricsHandler -> MetricsHandler, GetSecureMetricsHandler -> SecureMetricsHandler
  - bundles/configloader.Loader: GetConfigInfo -> ConfigInfo
  - bundles/httpclient.Client: GetCircuitBreakerState -> CircuitBreakerState, GetCircuitBreakerCounts -> CircuitBreakerCounts
  - bundles/jwt package funcs: GetServiceID -> ServiceID, GetServiceName -> ServiceName
  - bundles/httpclient.CredentialProvider's GetAPIKey/GetJWTToken are intentionally left unchanged:
    they are context-taking, error-returning fetch operations, not field accessors.
- health.HealthStatus renamed to health.Report to remove the package/type stutter;
  constructors renamed to match: NewHealthyStatus -> NewHealthyReport,
  NewUnhealthyStatus -> NewUnhealthyReport, NewUnknownStatus -> NewUnknownReport.
  health.Status, health.StatusResponse/NewStatusResponse, health.HealthySummary, and
  health.CheckResult are unchanged.
- errors/ package renamed to forgeerrors/ (import path
  github.com/datariot/forge/errors -> github.com/datariot/forge/forgeerrors) so it stops
  shadowing the stdlib errors package. The 6 bundles that used it (jwt, postgresql,
  httpclient, redis, configloader, prometheus) now import forge errors as forgeerrors
  and stdlib errors as plain "errors", dropping the stderrors alias where it existed.
- interface{} replaced with any (gofmt -r) across the module and all example modules.

All call sites, tests, examples, and docs (README.md, doc.go, CLAUDE.md, docs/*.md)
updated accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@datariot datariot merged commit 124a831 into main Jul 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant