Documentation
¶
Index ¶
- func NewCodeSnippetRepo(client *db.Client, logger *slog.Logger) domain.CodeSnippetRepo
- type CodeSnippetRepo
- func (r *CodeSnippetRepo) Create(ctx context.Context, req *domain.CreateCodeSnippetReq) (*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) Delete(ctx context.Context, id string) error
- func (r *CodeSnippetRepo) GetByID(ctx context.Context, id string) (*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) ListByWorkspaceFile(ctx context.Context, workspaceFileID string) ([]*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) Search(ctx context.Context, name, snippetType, language string) ([]*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) SearchByWorkspace(ctx context.Context, userID, workspacePath, name, snippetType, language string) ([]*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) SemanticSearch(ctx context.Context, embedding []float32, limit int) ([]*db.CodeSnippet, error)
- func (r *CodeSnippetRepo) SemanticSearchByWorkspace(ctx context.Context, userID, workspacePath string, embedding []float32, ...) ([]*db.CodeSnippet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCodeSnippetRepo ¶
Types ¶
type CodeSnippetRepo ¶
type CodeSnippetRepo struct {
// contains filtered or unexported fields
}
func (*CodeSnippetRepo) Create ¶
func (r *CodeSnippetRepo) Create(ctx context.Context, req *domain.CreateCodeSnippetReq) (*db.CodeSnippet, error)
func (*CodeSnippetRepo) Delete ¶
func (r *CodeSnippetRepo) Delete(ctx context.Context, id string) error
func (*CodeSnippetRepo) GetByID ¶
func (r *CodeSnippetRepo) GetByID(ctx context.Context, id string) (*db.CodeSnippet, error)
func (*CodeSnippetRepo) ListByWorkspaceFile ¶
func (r *CodeSnippetRepo) ListByWorkspaceFile(ctx context.Context, workspaceFileID string) ([]*db.CodeSnippet, error)
func (*CodeSnippetRepo) Search ¶
func (r *CodeSnippetRepo) Search(ctx context.Context, name, snippetType, language string) ([]*db.CodeSnippet, error)
Search 根据名称、类型和语言搜索代码片段
func (*CodeSnippetRepo) SearchByWorkspace ¶
func (r *CodeSnippetRepo) SearchByWorkspace(ctx context.Context, userID, workspacePath, name, snippetType, language string) ([]*db.CodeSnippet, error)
SearchByWorkspace 根据用户ID、工作区路径和搜索条件搜索代码片段 只有在提供了至少一个搜索条件时才返回结果,否则返回空数组
func (*CodeSnippetRepo) SemanticSearch ¶
func (r *CodeSnippetRepo) SemanticSearch(ctx context.Context, embedding []float32, limit int) ([]*db.CodeSnippet, error)
SemanticSearch performs a vector similarity search for code snippets
func (*CodeSnippetRepo) SemanticSearchByWorkspace ¶
func (r *CodeSnippetRepo) SemanticSearchByWorkspace(ctx context.Context, userID, workspacePath string, embedding []float32, limit int) ([]*db.CodeSnippet, error)
SemanticSearchByWorkspace performs a vector similarity search for code snippets within a specific workspace
Click to show internal directories.
Click to hide internal directories.