refactor!: idiomatic API naming cleanup (BREAKING)#5
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-1.0 breaking API cleanup so the public surface is idiomatic before people adopt it. Mechanical + compiler-verified; full
-racesuite, lint 0, all 7 example modules build.Breaking changes / migration
Get-prefix stripped from getters:
ObservabilityManager.GetTracer/GetMeterTracer/MeterRegistry.GetRegisteredChecks/GetCheckConfigRegisteredChecks/CheckConfigReport.GetHealthySummaryHealthySummaryprometheus.Bundle.GetMetricsHandler/GetSecureMetricsHandlerMetricsHandler/SecureMetricsHandlerconfigloader.Loader.GetConfigInfoConfigInfohttpclient.Client.GetCircuitBreakerState/GetCircuitBreakerCountsCircuitBreakerState/CircuitBreakerCountsjwt.GetServiceID/GetServiceNamejwt.ServiceID/ServiceNameCredentialProvider.GetAPIKey/GetJWTTokenare kept — they're context-taking, error-returning fetch operations, not field accessors.Stutter fix:
health.HealthStatus→health.Report; constructorsNewHealthyStatus/NewUnhealthyStatus/NewUnknownStatus→NewHealthyReport/NewUnhealthyReport/NewUnknownReport. TheStatusenum,StatusResponse,CheckResultare unchanged.Package rename:
github.com/datariot/forge/errors→github.com/datariot/forge/forgeerrors(viagit mv, history preserved). It no longer shadows stdliberrors, so the six bundles drop theirstderrorsaliasing workaround.Modernization:
interface{}→anytree-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