MCPcopy
hub / github.com/Tencent/WeKnora / stubKBOnlyService

Struct stubKBOnlyService

internal/handler/knowledgebase_not_found_test.go:38–42  ·  view source on GitHub ↗

validateAndGetKnowledgeBase (knowledgebase.go) and the four sibling helpers in faq.go / knowledge.go / tag.go / initialization.go used to wrap every Get*ByID error — including the well-known repository.ErrKnowledgeBaseNotFound sentinel — as a 500. That turned every probe of a stale or cross-tenant K

Source from the content-addressed store, hash-verified

36// other method nil-panicky on purpose so a future test that reaches
37// outside the contract fails loudly.
38type stubKBOnlyService struct {
39 interfaces.KnowledgeBaseService
40 getByID func(ctx context.Context, id string) (*types.KnowledgeBase, error)
41 fillKnowledgeBaseCounts func(ctx context.Context, kb *types.KnowledgeBase) error
42}
43
44func (s *stubKBOnlyService) GetKnowledgeBaseByID(ctx context.Context, id string) (*types.KnowledgeBase, error) {
45 return s.getByID(ctx, id)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected