MCPcopy Create free account
hub / github.com/compozy/agh / newHTTPModelCatalogRouter

Function newHTTPModelCatalogRouter

internal/api/httpapi/model_catalog_test.go:175–200  ·  view source on GitHub ↗
(
	t *testing.T,
	service coreModelCatalogService,
	boundHost string,
)

Source from the content-addressed store, hash-verified

173}
174
175func newHTTPModelCatalogRouter(
176 t *testing.T,
177 service coreModelCatalogService,
178 boundHost string,
179) http.Handler {
180 t.Helper()
181
182 cfg := testConfigWithDisabledNetwork(newTestHomePaths(t))
183 cfg.HTTP.Host = boundHost
184 cfg.HTTP.Port = 2123
185 handlers := newHandlers(&handlerConfig{
186 modelCatalog: service,
187 staticFS: mustStaticFS(t),
188 config: cfg,
189 boundHost: boundHost,
190 logger: discardLogger(),
191 startedAt: time.Date(2026, 4, 3, 12, 0, 0, 0, time.UTC),
192 now: func() time.Time { return time.Date(2026, 4, 3, 12, 0, 1, 0, time.UTC) },
193 pollInterval: 5 * time.Millisecond,
194 agentLoader: aghconfig.LoadAgentDef,
195 httpPort: cfg.HTTP.Port,
196 workspaces: stubWorkspaceService{},
197 tasks: stubTaskManager{},
198 })
199 return newTestRouter(t, handlers)
200}
201
202type coreModelCatalogService interface {
203 ListModels(context.Context, modelcatalog.ListOptions) ([]modelcatalog.Model, error)

Callers 1

Calls 6

mustStaticFSFunction · 0.85
newTestHomePathsFunction · 0.70
newHandlersFunction · 0.70
discardLoggerFunction · 0.70
newTestRouterFunction · 0.70

Tested by

no test coverage detected