Documentation ¶
Index ¶
- type InfoStore
- func (v *InfoStore) CleanOrphans(pkgs map[string]alpm.IPackage)
- func (v *InfoStore) Load() error
- func (v *InfoStore) RemovePackages(pkgs []string)
- func (v *InfoStore) Save() error
- func (v *InfoStore) ToUpgrade(ctx context.Context, pkgName string) bool
- func (v *InfoStore) Update(ctx context.Context, pkgName string, sources []gosrc.ArchString)
- type Mock
- func (m *Mock) CleanOrphans(pkgs map[string]alpm.IPackage)
- func (m *Mock) Load() error
- func (m *Mock) RemovePackages(pkgs []string)
- func (m *Mock) Save() error
- func (m *Mock) ToUpgrade(ctx context.Context, pkgName string) bool
- func (m *Mock) Update(ctx context.Context, pkgName string, sources []gosrc.ArchString)
- type OriginInfo
- type OriginInfoByURL
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfoStore ¶
type InfoStore struct { OriginsByPackage map[string]OriginInfoByURL FilePath string CmdBuilder exe.GitCmdBuilder // contains filtered or unexported fields }
InfoStore is a collection of OriginInfoByURL by Package. Containing a map of last commit SHAs of a repo.
func NewInfoStore ¶
func (*InfoStore) CleanOrphans ¶
func (*InfoStore) RemovePackages ¶
RemovePackage removes package from VCS information.
type Mock ¶
type Mock struct { OriginsByPackage map[string]OriginInfoByURL ToUpgradeReturn []string }
func (*Mock) CleanOrphans ¶
func (*Mock) RemovePackages ¶
type OriginInfo ¶
type OriginInfo struct { Protocols []string `json:"protocols"` Branch string `json:"branch"` SHA string `json:"sha"` }
OriginInfo contains the last commit sha of a repo Example:
"github.com/Jguer/yay.git": { "protocols": [ "https" ], "branch": "next", "sha": "c1171d41467c68ffd3c46748182a16366aaaf87b" }.
type OriginInfoByURL ¶
type OriginInfoByURL map[string]OriginInfo
OriginInfoByURL stores the OriginInfo of each origin URL provided.
type Store ¶
type Store interface { // ToUpgrade returns true if the package needs to be updated. ToUpgrade(ctx context.Context, pkgName string) bool // Update updates the VCS info of a package. Update(ctx context.Context, pkgName string, sources []gosrc.ArchString) // RemovePackages removes the VCS info of the packages given as arg if they exist. RemovePackages(pkgs []string) // Clean orphaned VCS info. CleanOrphans(pkgs map[string]alpm.IPackage) // Load loads the VCS info from disk. Load() error // Save saves the VCS info to disk. Save() error }
Click to show internal directories.
Click to hide internal directories.