Skip to content

Migration: extraction facade re-exports removed

The transport-stack extraction left GTB re-exporting the extracted modules from pkg/* so call sites kept working unchanged. Those pure re-export surfaces have now been removed — GTB imports the modules directly, and so should you. This is a breaking change for code that leaned on the re-exports; the fix is a one-line import repoint per symbol.

What did not change: the config.Containable server adapters (NewServerFromContainable, RegisterFromContainable, ServerSettingsFromConfig, RateLimitConfigFromConfig, … with WithConfigPrefix/WithPort), the chat *FromProps adapters and config-key schema, chat provider registration, and all of pkg/tls (including tls.Resolve and tls.Pair). Build your servers/clients from GTB config exactly as before.

What was removed and where it lives now

Removed re-export Import instead Symbols
pkg/http client factory (client.go) gitlab.com/phpboyscout/go/httpclient NewClient, NewTransport, ClientOption, WithTimeout, WithMaxRedirects, WithTLSConfig, WithTransport, WithCertPool, WithRetry, WithClientMiddleware
pkg/http transit middleware (reexport.go) gitlab.com/phpboyscout/go/transit/http Chain, Middleware, NewChain, LoggingMiddleware, OTelMiddleware, RateLimitMiddleware, RateLimitConfig, CircuitBreakerConfig, RetryConfig, ClientChain, NewClientChain, WithBearerToken, …
pkg/grpc transit interceptors (reexport.go) gitlab.com/phpboyscout/go/transit/grpc Interceptor, InterceptorChain, NewInterceptorChain, LoggingInterceptor, OTelStatsHandler, OTelClientHandler, RateLimitConfig, CircuitBreakerConfig, CircuitBreakerInterceptor, …
pkg/chat (reexport.go) gitlab.com/phpboyscout/go/chat ChatClient, Config, New, Tool, Provider*, DefaultModel*, DefaultMaxSteps, the sentinel errors, …

How to migrate

Repoint the import; the symbol names are identical.

// HTTP client — was:
//   client := gtbhttp.NewClient(gtbhttp.WithTimeout(10*time.Second))
// now:
import "gitlab.com/phpboyscout/go/httpclient"
client := httpclient.NewClient(httpclient.WithTimeout(10 * time.Second))

// HTTP middleware — was gtbhttp.NewChain(...); now:
import transithttp "gitlab.com/phpboyscout/go/transit/http"
chain := transithttp.NewChain(/* … */)

// gRPC interceptors — was gtbgrpc.NewInterceptorChain(...); now:
import transitgrpc "gitlab.com/phpboyscout/go/transit/grpc"
ic := transitgrpc.NewInterceptorChain(/* … */)

// Chat — was chat.New(...) from pkg/chat; now:
import gochat "gitlab.com/phpboyscout/go/chat"
c, err := gochat.New(/* … */)

The GTB pkg/chat package still exists for the Props/config integration (chat.NewFromProps, chat.SettingsFromProps, the config-key constants) and still blank-imports the provider modules — keep importing it for those. A file that uses both the GTB glue and the module's types aliases the module as gochat.

Notes

  • pkg/tls was deliberately left as a facadetls.Resolve (config → tls.Pair) is load-bearing and the re-exported tls.Pair/tls.DefaultConfig are used pervasively; removing them was assessed as net-negative.
  • The chat mocks under mocks/pkg/chat/ now mock go/chat's ChatClient directly; they are hand-maintained (mockery's pkg/ sweep no longer discovers the interface, which lives in go/chat).
  • Module docs: httpclient, transit, chat.