git

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutCommit added in v0.12.0

func CheckoutCommit(target string, commit string) error

func CheckoutTag added in v0.18.1

func CheckoutTag(target, name string) error

func Clone

func Clone(src string, dst string) error

func CloneOrPull added in v0.12.0

func CloneOrPull(src string, dst string) error

func GetTagsFromRemote added in v0.29.0

func GetTagsFromRemote(remote *git.Remote) (VersionInfo, VersionCollection, error)

GetLatestTagFromRepo returns the latest tag and a list of all tags from a repo

func GetTagsFromRepo added in v0.29.0

func GetTagsFromRepo(source string) (VersionInfo, VersionCollection, error)

func IsValidGitUrl

func IsValidGitUrl(url string) bool

func ParseAsUrl added in v0.29.0

func ParseAsUrl(url string) (*url.URL, error)

func ParseAsVcsUrl added in v0.29.0

func ParseAsVcsUrl(url string) (*vcsurl.VCS, error)

func Pull

func Pull(dst string) error

func SortRepoInfo added in v0.16.2

func SortRepoInfo(infos []*RepoInfo)

Types

type RepoInfo added in v0.16.0

type RepoInfo struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Author      string            `json:"author"`
	Path        string            `json:"path"`
	Git         string            `json:"git"`
	Commit      string            `json:"commit"`
	Version     VersionInfo       `json:"version"`
	Latest      VersionInfo       `json:"latest"`
	Versions    VersionCollection `json:"versions"`
	InCache     bool              `json:"inCache"`
	InRegistry  bool              `json:"inRegistry"`
}

func LocalRepoInfo added in v0.29.0

func LocalRepoInfo(source string) (*RepoInfo, error)

func RemoteRepoInfo added in v0.12.0

func RemoteRepoInfo(url string) (*RepoInfo, error)

func (*RepoInfo) FQN added in v0.29.0

func (r *RepoInfo) FQN() string

func (*RepoInfo) VersionName added in v0.29.0

func (r *RepoInfo) VersionName() string

type VersionCollection added in v0.12.0

type VersionCollection []VersionInfo

VersionCollection is a collection of tags it implements sort.Interface

func (VersionCollection) AsList added in v0.16.2

func (c VersionCollection) AsList() []string

func (VersionCollection) Latest added in v0.12.0

func (c VersionCollection) Latest() VersionInfo

Latest returns the latest tag info

func (VersionCollection) Len added in v0.12.0

func (c VersionCollection) Len() int

Len is the number of elements in the collection.

func (VersionCollection) Less added in v0.12.0

func (c VersionCollection) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (VersionCollection) String added in v0.29.0

func (c VersionCollection) String() string

func (VersionCollection) Swap added in v0.12.0

func (c VersionCollection) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type VersionInfo added in v0.12.0

type VersionInfo struct {
	Name    string          `json:"name"`
	SHA     string          `json:"sha"`
	Version *semver.Version `json:"version"`
}

VersionInfo contains information about a tag

Jump to

Keyboard shortcuts

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