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

Interface KBLookup

internal/middleware/kb_access.go:87–89  ·  view source on GitHub ↗

KBLookup is the minimum surface ResolveKBAccess needs from the knowledge-base service: a single method that turns an ID into a KnowledgeBase pointer (or repo.ErrKnowledgeBaseNotFound). Defining it as a tiny dedicated interface keeps the guard testable without forcing test stubs to satisfy the full K

Source from the content-addressed store, hash-verified

85// it as a tiny dedicated interface keeps the guard testable without
86// forcing test stubs to satisfy the full KnowledgeBaseService surface.
87type KBLookup interface {
88 GetKnowledgeBaseByID(ctx context.Context, id string) (*types.KnowledgeBase, error)
89}
90
91// KnowledgeLookup mirrors KBLookup but for resolving a knowledge id
92// (document id) back to its parent KB. Used by the chunk routes whose

Callers 8

resolveKBAccessOnceFunction · 0.65
DeleteKnowledgeMethod · 0.65
DeleteKnowledgeListMethod · 0.65

Implementers 15

stubKBLookupinternal/middleware/kb_access_test.go
knowledgeBaseServiceinternal/application/service/knowledge
stubKBServiceForChaininternal/application/service/knowledge
stubKBRepoForModelDeleteinternal/application/service/model_del
processSyncKBServiceinternal/application/service/datasourc
fakeKBRepointernal/application/service/knowledge
createKnowledgeFileKBServiceStubinternal/application/service/knowledge
realKBRepointernal/application/service/vectorsto
fakeAgentKnowledgeBaseServiceinternal/application/service/agent_ser
knowledgeBaseRepositoryinternal/application/repository/knowle
stubKnowledgeBaseServiceinternal/agent/tools/query_knowledge_g
stubKBOnlyServiceinternal/handler/knowledgebase_not_fou

Calls

no outgoing calls

Tested by

no test coverage detected