Connect backend refactor (#801)

* Move connect backend code to its own package
* Move errors into the connect package
* Add NewBackend func
This commit is contained in:
Dan Sosedoff
2025-11-11 10:19:05 -08:00
committed by GitHub
parent 266a516076
commit 70f62feec8
6 changed files with 133 additions and 117 deletions

20
pkg/connect/types.go Normal file
View File

@@ -0,0 +1,20 @@
package connect
import "errors"
var (
errBackendConnectError = errors.New("unable to connect to the auth backend")
errConnStringRequired = errors.New("connection string is required")
)
// Request holds the resource request details
type Request struct {
Resource string `json:"resource"`
Token string `json:"token"`
Headers map[string]string `json:"headers,omitempty"`
}
// Credential holds the database connection string
type Credential struct {
DatabaseURL string `json:"database_url"`
}