Documentation
¶
Index ¶
- func CalculateIntegrity(dir string) (string, error)
- func VerifyIntegrity(dir string, expected string) (bool, error)
- type LockedEntry
- type Lockfile
- func (lf *Lockfile) Count() int
- func (lf *Lockfile) Entries() map[string]*LockedEntry
- func (lf *Lockfile) Get(name string) (*LockedEntry, bool)
- func (lf *Lockfile) IsLocked(name string) bool
- func (lf *Lockfile) Lock(name string, entry *LockedEntry)
- func (lf *Lockfile) NeedsUpdate(name string, newCommit, newVersion string) bool
- func (lf *Lockfile) Path() string
- func (lf *Lockfile) Save() error
- func (lf *Lockfile) SaveTo(path string) error
- func (lf *Lockfile) Unlock(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateIntegrity ¶
CalculateIntegrity calculates a SHA256 hash of a directory's contents
Types ¶
type LockedEntry ¶
type LockedEntry struct {
Source string `json:"source"` // Git URL or alias
Version string `json:"version,omitempty"` // Semver version if available
Commit string `json:"commit,omitempty"` // Git commit hash
Integrity string `json:"integrity,omitempty"` // SHA256 hash of installed files
InstalledAt time.Time `json:"installedAt"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
LockedEntry represents a locked server entry
type Lockfile ¶
type Lockfile struct {
Version string `json:"version"`
Locked map[string]*LockedEntry `json:"locked"`
// contains filtered or unexported fields
}
Lockfile represents the agentctl.lock file that tracks exact versions
func (*Lockfile) Entries ¶
func (lf *Lockfile) Entries() map[string]*LockedEntry
Entries returns all locked entries
func (*Lockfile) Get ¶
func (lf *Lockfile) Get(name string) (*LockedEntry, bool)
Get returns a locked entry if it exists
func (*Lockfile) Lock ¶
func (lf *Lockfile) Lock(name string, entry *LockedEntry)
Lock adds or updates a locked entry
func (*Lockfile) NeedsUpdate ¶
NeedsUpdate checks if a locked entry needs updating Returns true if the commit or version has changed
Click to show internal directories.
Click to hide internal directories.