Documentation
¶
Index ¶
- Constants
- func CalculateSHA256FromBytes(data []byte) string
- func GetGlobalCacheDir() string
- func ValidateManifest(manifest *Manifest) []error
- func WriteManifest(path string, manifest *Manifest) error
- type Lockfile
- func (l *Lockfile) AddEntry(entry LockfileEntry)
- func (l *Lockfile) CalculateSHA256() (string, error)
- func (l *Lockfile) GetContentHash(repoURL, specPath string) (string, bool)
- func (l *Lockfile) GetEntry(repoURL, specPath string) (*LockfileEntry, bool)
- func (l *Lockfile) GetRepositoryEntries(repoURL string) []LockfileEntry
- func (l *Lockfile) RemoveEntry(repoURL, specPath string) bool
- func (l *Lockfile) Verify(manifest *Manifest) ([]string, error)
- func (l *Lockfile) Write(path string) error
- type LockfileEntry
- type Manifest
- type ResolveResult
- type Resolver
- type ValidationError
Constants ¶
const (
ManifestVersion = "1.0.0"
)
Format version constants
Variables ¶
This section is empty.
Functions ¶
func CalculateSHA256FromBytes ¶
CalculateSHA256FromBytes calculates SHA-256 hash of byte data
func GetGlobalCacheDir ¶
func GetGlobalCacheDir() string
GetGlobalCacheDir returns the global cache directory
func ValidateManifest ¶
ValidateManifest validates a manifest
func WriteManifest ¶
WriteManifest writes a manifest to a file
Types ¶
type Lockfile ¶
type Lockfile struct {
Version string
Entries []LockfileEntry
Timestamp time.Time
TotalSize int64
}
Lockfile represents the lockfile (spec.sum) that contains resolved dependencies
func ReadLockfile ¶
Read reads a lockfile from disk
func (*Lockfile) AddEntry ¶
func (l *Lockfile) AddEntry(entry LockfileEntry)
AddEntry adds an entry to the lockfile
func (*Lockfile) CalculateSHA256 ¶
CalculateSHA256 calculates the SHA-256 hash of the lockfile content
func (*Lockfile) GetContentHash ¶
GetContentHash retrieves the content hash for a dependency
func (*Lockfile) GetEntry ¶
func (l *Lockfile) GetEntry(repoURL, specPath string) (*LockfileEntry, bool)
GetEntry retrieves an entry from the lockfile
func (*Lockfile) GetRepositoryEntries ¶
func (l *Lockfile) GetRepositoryEntries(repoURL string) []LockfileEntry
GetRepositoryEntries retrieves all entries for a given repository
func (*Lockfile) RemoveEntry ¶
RemoveEntry removes an entry from the lockfile
type LockfileEntry ¶
type LockfileEntry struct {
RepositoryURL string `json:"repository_url"`
CommitHash string `json:"commit_hash"`
ContentHash string `json:"content_hash"`
SpecPath string `json:"spec_path"`
Branch string `json:"branch,omitempty"`
Size int64 `json:"size"`
FetchedAt string `json:"fetched_at"`
}
LockfileEntry represents a single entry in the lockfile
type Manifest ¶
type Manifest struct {
Version string
Dependecies []models.Dependency
ID string
Path string
UpdatedAt time.Time
}
Manifest represents the parsed spec.mod file
func ParseManifest ¶
ParseManifest parses a spec.mod file
type ResolveResult ¶
type ResolveResult struct {
Dependency *models.Dependency
CommitHash string
Content []byte
ContentHash string
Size int64
Source string
}
ResolveResult represents the result of a dependency resolution
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves dependencies by fetching specs from Git repositories
func NewResolver ¶
NewResolver creates a new resolver with global cache directory
func (*Resolver) GetCachePath ¶
func (r *Resolver) GetCachePath(dep models.Dependency, commitHash string) string
GetCachePath returns the cache path for a dependency This can be used by LLMs to read cached specs
type ValidationError ¶
ValidationError represents a validation error
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error returns the error message