vcs

package
v10.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: GPL-3.0 Imports: 10 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
	Runner           exe.Runner
	CmdBuilder       *exe.CmdBuilder
}

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

func NewInfoStore

func NewInfoStore(filePath string, runner exe.Runner, cmdBuilder *exe.CmdBuilder) *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(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(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

Jump to

Keyboard shortcuts

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