Documentation
¶
Overview ¶
Package source manages multi-repo source tracking with git commit awareness.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveManifest ¶
SaveManifest saves the manifest to a graph directory.
Types ¶
type Manifest ¶
type Manifest struct {
// Sources is the list of tracked repositories.
Sources []*Source `json:"sources"`
// Directed indicates whether the graph should be treated as directed.
// Default is true (edges have direction from->to).
Directed bool `json:"directed"`
// CreatedAt is when the manifest was created.
CreatedAt time.Time `json:"created_at"`
// UpdatedAt is when the manifest was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Manifest tracks all sources in a Graphize database.
func LoadManifest ¶
LoadManifest loads the manifest from a graph directory. Returns an empty manifest if the file doesn't exist.
func (*Manifest) CheckAllStatus ¶
func (m *Manifest) CheckAllStatus() ([]*SourceStatus, error)
CheckAllStatus checks the status of all sources in the manifest.
func (*Manifest) RemoveSource ¶
RemoveSource removes a source from the manifest by path.
type Source ¶
type Source struct {
// Path is the absolute path to the repository root.
Path string `json:"path"`
// Commit is the git commit hash that was last analyzed.
Commit string `json:"commit"`
// Branch is the git branch that was checked out during analysis.
Branch string `json:"branch"`
// AnalyzedAt is when the source was last analyzed.
AnalyzedAt time.Time `json:"analyzed_at"`
}
Source represents a tracked source repository.
func NewSourceFromPath ¶
NewSourceFromPath creates a Source from a git repository path.
type SourceStatus ¶
type SourceStatus struct {
Source *Source
CurrentCommit string
CurrentBranch string
IsStale bool
CommitsBehind int // -1 if unknown
}
SourceStatus represents the currency status of a source.
func CheckStatus ¶
func CheckStatus(s *Source) (*SourceStatus, error)
CheckStatus checks if a source is current with git HEAD.
Click to show internal directories.
Click to hide internal directories.