feat: phase 8 serviceadapter crd rollout (32/33 tasks)

This commit is contained in:
Admin Bot
2026-08-26 13:47:36 -07:00
parent 63893d41a5
commit 425611ec42
85 changed files with 4238 additions and 5702 deletions
+59
View File
@@ -0,0 +1,59 @@
package serviceadapter
import (
"time"
)
// Upstream defines an upstream target.
type Upstream struct {
URL string `json:"url"`
TimeoutSeconds int32 `json:"timeoutSeconds"`
}
// Auth defines authentication requirements.
type Auth struct {
Required bool `json:"required"`
Capability string `json:"capability,omitempty"`
}
// Method defines an HTTP method endpoint.
type Method struct {
Verb string `json:"verb"`
UpstreamPath string `json:"upstreamPath"`
RequestSchema string `json:"requestSchema,omitempty"`
ResponseSchema string `json:"responseSchema,omitempty"`
Auth *Auth `json:"auth,omitempty"`
}
// Resource defines a resource with multiple methods.
type Resource struct {
Name string `json:"name"`
Methods []Method `json:"methods"`
Auth *Auth `json:"auth,omitempty"`
}
// Spec is the ServiceAdapter spec.
type Spec struct {
ServiceName string `json:"serviceName"`
Upstream Upstream `json:"upstream"`
Auth Auth `json:"auth"`
Retryable bool `json:"retryable,omitempty"`
Resources []Resource `json:"resources"`
}
// Status is the ServiceAdapter status.
type Status struct {
Ready bool `json:"ready,omitempty"`
Error string `json:"error,omitempty"`
LastSyncTime *time.Time `json:"lastSyncTime,omitempty"`
}
// ServiceAdapter is a gateway service adapter.
type ServiceAdapter struct {
Name string // namespace/name
Namespace string
ServiceName string
Spec Spec
Status Status
CreatedAt time.Time
}