Documentation
¶
Overview ¶
Package v2 resolves legacy API routes only from verified, installed package artifacts. It deliberately has no dependency on the design-time catalog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrRouteNotDeclared = errors.New("v2 package route is not declared") )
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface {
Dispatch(context.Context, pluginhost.DispatchInput) (pluginhost.DispatchOutput, error)
}
type Gateway ¶
type Gateway struct {
Registry *Registry
Dispatcher Dispatcher
Timeout time.Duration
RequestBodyLimit int64
}
Gateway is the unary v2 compatibility boundary. It has no legacy handler fallback: a route must resolve from an active, verified package artifact.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(source RouteSource) *Registry
type Route ¶
type Route struct {
Method string
LegacyPath string
PackageID string
Version string
PackageRoute string
Envelope Envelope
Generation uint64
Transport Transport
}
Route is a request-time route authorization bound to one verified package release and one running installation generation.
type RouteSource ¶
RouteSource performs the trusted, request-time route lookup.
func NewVerifiedRouteSource ¶
func NewVerifiedRouteSource(db *gorm.DB, encodedPublicKey string) RouteSource
NewVerifiedRouteSource creates the production resolver. An invalid trust root is retained as a fail-closed resolver error rather than falling back to any source-derived catalog entry.
type WebSocketGateway ¶
type WebSocketGateway struct {
Registry *Registry
Dispatcher pluginhost.WebSocketManager
Timeout time.Duration
SessionTimeout time.Duration
Upgrade WebSocketUpgrade
}
WebSocketGateway resolves and opens a package relay before accepting the browser upgrade. Legacy socket handlers are intentionally not reachable.
func (WebSocketGateway) Serve ¶
func (g WebSocketGateway) Serve(c *gin.Context)
func (WebSocketGateway) ServeHTTP ¶
func (g WebSocketGateway) ServeHTTP(writer http.ResponseWriter, request *http.Request)
ServeHTTP is useful for non-Gin integration points and keeps resolution before upgrade testable without a real WebSocket connection.