Documentation ¶
Overview ¶
Package client contains common functions for the GooGet client.
Index ¶
- func FindRepoLatest(pi goolib.PackageInfo, rm RepoMap, archs []string) (ver, repo, arch string, err error)
- func FindRepoSpec(pi goolib.PackageInfo, pl []goolib.RepoSpec) (goolib.RepoSpec, error)
- func RemoveOrRename(filename string) error
- func WhatRepo(pi goolib.PackageInfo, rm RepoMap) (string, error)
- type GooGetState
- type PackageState
- type RepoMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindRepoLatest ¶
func FindRepoLatest(pi goolib.PackageInfo, rm RepoMap, archs []string) (ver, repo, arch string, err error)
FindRepoLatest returns the latest version of a package along with its repo and arch.
func FindRepoSpec ¶
FindRepoSpec returns the element of pl whose PackageSpec matches pi.
func RemoveOrRename ¶
RemoveOrRename attempts to remove a file or directory. If it fails and it's a file, attempt to rename it into a temp file on windows so that it can be effectively overridden
Types ¶
type GooGetState ¶
type GooGetState []PackageState
GooGetState describes the overall package state on a client.
func UnmarshalState ¶
func UnmarshalState(b []byte) (*GooGetState, error)
UnmarshalState unmarshals data into GooGetState.
func (*GooGetState) GetPackageState ¶
func (s *GooGetState) GetPackageState(pi goolib.PackageInfo) (PackageState, error)
GetPackageState returns the PackageState of the matching goolib.PackageInfo, or error if no match is found.
func (*GooGetState) Marshal ¶
func (s *GooGetState) Marshal() ([]byte, error)
Marshal JSON marshals GooGetState.
func (*GooGetState) Remove ¶
func (s *GooGetState) Remove(pi goolib.PackageInfo) error
Remove removes a PackageState.
type PackageState ¶
type PackageState struct {
SourceRepo, DownloadURL, Checksum, UnpackDir string
PackageSpec *goolib.PkgSpec
InstalledFiles map[string]string
}
PackageState describes the state of a package on a client.
func (*PackageState) Match ¶
func (ps *PackageState) Match(pi goolib.PackageInfo) bool
Match reports whether the PackageState corresponds to the package info.