Documentation
¶
Overview ¶
Package tracking provides progress tracking and reporting types for long-running tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReferenceType ¶
type ReferenceType string
ReferenceType represents types of git references that can be tracked.
const ( ReferenceTypeBranch ReferenceType = "branch" ReferenceTypeTag ReferenceType = "tag" ReferenceTypeCommitSHA ReferenceType = "commit_sha" )
ReferenceType values.
func (ReferenceType) String ¶
func (r ReferenceType) String() string
String returns the string representation.
type RepositoryStatusSummary ¶
type RepositoryStatusSummary struct {
// contains filtered or unexported fields
}
RepositoryStatusSummary provides a summary of repository indexing status. It aggregates task status information into a high-level view.
func NewRepositoryStatusSummary ¶
func NewRepositoryStatusSummary(status snippet.IndexStatus, message string, updatedAt time.Time) RepositoryStatusSummary
NewRepositoryStatusSummary creates a new RepositoryStatusSummary.
func StatusSummaryFromTasks ¶
func StatusSummaryFromTasks(tasks []task.Status, pendingTaskCount int) RepositoryStatusSummary
StatusSummaryFromTasks derives a RepositoryStatusSummary from task statuses. Priority: in_progress/started > pending_queue > completed_with_errors/failed > completed > pending. When all tasks are terminal and failures exist, returns completed_with_errors if more tasks succeeded than failed, otherwise returns failed.
func (RepositoryStatusSummary) Message ¶
func (s RepositoryStatusSummary) Message() string
Message returns the status message (typically error message if failed).
func (RepositoryStatusSummary) Status ¶
func (s RepositoryStatusSummary) Status() snippet.IndexStatus
Status returns the overall indexing status.
func (RepositoryStatusSummary) UpdatedAt ¶
func (s RepositoryStatusSummary) UpdatedAt() time.Time
UpdatedAt returns the timestamp of the most recent activity.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves trackables to ordered lists of commit SHAs. This is a domain service that orchestrates multiple repositories (branches, tags, commits) to resolve references.
func NewResolver ¶
func NewResolver( commitStore repository.CommitStore, branchStore repository.BranchStore, tagStore repository.TagStore, logger *slog.Logger, ) *Resolver
NewResolver creates a new trackable resolver.
type Trackable ¶
type Trackable struct {
// contains filtered or unexported fields
}
Trackable represents a trackable reference point in a git repository. It is an immutable value object that identifies a specific point in git history.
func NewTrackable ¶
func NewTrackable(refType ReferenceType, identifier string, repoID int64) Trackable
NewTrackable creates a new Trackable.
func (Trackable) Identifier ¶
Identifier returns the identifier (branch name, tag name, or commit SHA).
func (Trackable) IsCommitSHA ¶
IsCommitSHA returns true if this is a direct commit SHA reference.
func (Trackable) Type ¶
func (t Trackable) Type() ReferenceType
Type returns the reference type (branch, tag, or commit_sha).