repo

package
v0.0.0-...-c20d9b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodeSnippetRepo

func NewCodeSnippetRepo(client *db.Client, logger *slog.Logger) domain.CodeSnippetRepo

Types

type CodeSnippetRepo

type CodeSnippetRepo struct {
	// contains filtered or unexported fields
}

func (*CodeSnippetRepo) Create

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL