vcs

package
Version: v11.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

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
}

InfoStore is a collection of OriginInfoByURL by Package. Containing a map of last commit SHAs of a repo.

func NewInfoStore

func NewInfoStore(filePath string, cmdBuilder exe.GitCmdBuilder) *InfoStore

func (InfoStore) Load

func (v InfoStore) Load() error

LoadStore reads a json file and populates a InfoStore structure.

func (*InfoStore) NeedsUpdate

func (v *InfoStore) NeedsUpdate(ctx context.Context, infos OriginInfoByURL) bool

func (*InfoStore) RemovePackage

func (v *InfoStore) RemovePackage(pkgs []string)

RemovePackage removes package from VCS information.

func (*InfoStore) Save

func (v *InfoStore) Save() error

func (*InfoStore) Update

func (v *InfoStore) Update(ctx context.Context, pkgName string,
	sources []gosrc.ArchString, mux sync.Locker, wg *sync.WaitGroup)

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL