MCPcopy Create free account
hub / github.com/astercloud/aster / CompositeBackend

Struct CompositeBackend

pkg/backends/composite.go:19–22  ·  view source on GitHub ↗

CompositeBackend 组合路由后端 根据路径前缀将请求路由到不同的后端 例如: "/" -> StateBackend, "/memories/" -> StoreBackend, "/workspace/" -> FilesystemBackend

Source from the content-addressed store, hash-verified

17// 根据路径前缀将请求路由到不同的后端
18// 例如: "/" -> StateBackend, "/memories/" -> StoreBackend, "/workspace/" -> FilesystemBackend
19type CompositeBackend struct {
20 defaultBackend BackendProtocol
21 routes []RouteConfig // 按前缀长度降序排列,优先匹配最长前缀
22}
23
24// NewCompositeBackend 创建 CompositeBackend 实例
25func NewCompositeBackend(defaultBackend BackendProtocol, routes []RouteConfig) *CompositeBackend {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected