Packages
Search packages... ⌘K
Go Package
clientregistry
Client registry — centralized HTTP client pool with per-service configuration
Go Ready SI
Registry Initialization go
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// Initialize registry from config — creates all service adapters
registry, err := clientregistry.NewRegistry(cfg)
// Route handlers retrieve pre-configured clients by name
func handleDeploy(w http.ResponseWriter, r *http.Request) {
dokploy, err := registry.Get("dokploy")
if err != nil {
http.Error(w, "service unavailable", 503)
return
}
resp, err := dokploy.Request(r.Context(), "POST", "/deploy", body)
// Retry, auth, timeout already configured — handler stays clean
}About
Maintains a centralized registry of HTTP client adapters, one per external service. Route handlers retrieve pre-configured clients by service name instead of constructing their own, ensuring consistent retry, auth, and timeout behavior across the application.
Public API
| Name | Kind | Signature |
|---|---|---|
| Registry | type | type Registry struct |
| NewRegistry | func | func NewRegistry(cfg Config) (*Registry, error) |
| Get | func | func (r *Registry) Get(name string) (*adapter.Adapter, error) |
| Register | func | func (r *Registry) Register(name string, a *adapter.Adapter) |
Dependencies
Imports (2)
Related Packages
Source
github.com/shredbx/sbx-core/pkg/clientregistry
client-poolservice-registrycentralizedconfiguration