Documentation
¶
Overview ¶
Package handler provides task handlers for processing queued operations.
Index ¶
- Variables
- func ExtractInt64(payload map[string]any, key string) (int64, error)
- func ExtractString(payload map[string]any, key string) (string, error)
- func ShortSHA(sha string) string
- type CommitPayload
- type EnrichmentContext
- type GitInfrastructure
- type Handler
- type Registry
- type RepositoryStores
- type Tracker
- type TrackerFactory
- type VectorIndex
Constants ¶
This section is empty.
Variables ¶
var ErrNoHandler = errors.New("no handler registered")
ErrNoHandler indicates no handler is registered for the operation.
Functions ¶
func ExtractInt64 ¶
ExtractInt64 extracts an int64 value from the payload.
func ExtractString ¶
ExtractString extracts a string value from the payload.
Types ¶
type CommitPayload ¶
type CommitPayload struct {
// contains filtered or unexported fields
}
CommitPayload holds the common repository_id and commit_sha fields extracted from task payloads.
func ExtractCommitPayload ¶
func ExtractCommitPayload(payload map[string]any) (CommitPayload, error)
ExtractCommitPayload extracts the common repository_id and commit_sha fields from a task payload.
func (CommitPayload) CommitSHA ¶
func (p CommitPayload) CommitSHA() string
CommitSHA returns the commit SHA.
func (CommitPayload) RepoID ¶
func (p CommitPayload) RepoID() int64
RepoID returns the repository ID.
type EnrichmentContext ¶
type EnrichmentContext struct {
Enrichments enrichment.EnrichmentStore
Associations enrichment.AssociationStore
Enricher domainservice.Enricher
Tracker TrackerFactory
Logger zerolog.Logger
}
EnrichmentContext holds the stores and services shared by all enrichment handlers.
type GitInfrastructure ¶
type GitInfrastructure struct {
Adapter git.Adapter
Cloner domainservice.Cloner
Scanner domainservice.Scanner
}
GitInfrastructure provides git cloning, updating, and scanning operations.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps task operations to their handlers.
func (*Registry) Handler ¶
Handler returns the handler for a task operation. Returns ErrNoHandler if no handler is registered.
func (*Registry) HasHandler ¶
HasHandler checks if a handler is registered for the operation.
func (*Registry) Operations ¶
Operations returns all registered operations.
type RepositoryStores ¶
type RepositoryStores struct {
Repositories repository.RepositoryStore
Commits repository.CommitStore
Branches repository.BranchStore
Tags repository.TagStore
Files repository.FileStore
}
RepositoryStores groups the persistence stores for repository-related entities.
type Tracker ¶
type Tracker interface {
SetTotal(ctx context.Context, total int)
SetCurrent(ctx context.Context, current int, message string)
Skip(ctx context.Context, message string)
Fail(ctx context.Context, message string)
Complete(ctx context.Context)
}
Tracker provides progress tracking for task execution.
type TrackerFactory ¶
type TrackerFactory interface {
ForOperation(operation task.Operation, trackableType task.TrackableType, trackableID int64) Tracker
}
TrackerFactory creates trackers for progress reporting.
type VectorIndex ¶
type VectorIndex struct {
Embedding domainservice.Embedding
Store search.EmbeddingStore
}
VectorIndex pairs an embedding domain service with its backing vector store.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package enrichment provides task handlers for enrichment operations.
|
Package enrichment provides task handlers for enrichment operations. |