Documentation ¶
Overview ¶
Package client contains common functions for the GooGet client.
Index ¶
- func FindRepoLatest(pi goolib.PackageInfo, rm RepoMap, archs []string) (string, string, string, error)
- func FindRepoSpec(pi goolib.PackageInfo, repo Repo) (goolib.RepoSpec, error)
- func Get(ctx context.Context, path, proxyServer string) (*http.Response, error)
- func RemoveOrRename(filename string) (string, error)
- func WhatRepo(pi goolib.PackageInfo, rm RepoMap) (string, error)
- type GooGetState
- type PackageState
- type Repo
- type RepoMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindRepoLatest ¶
func FindRepoLatest(pi goolib.PackageInfo, rm RepoMap, archs []string) (string, string, string, error)
FindRepoLatest returns the latest version of a package along with its repo and arch. The archs are searched in order; if a matching package is found for any arch, it is returned immediately even if a later arch might have a later version.
func FindRepoSpec ¶
FindRepoSpec returns the RepoSpec in repo whose PackageSpec matches pi.
func Get ¶ added in v2.18.3
Get gets a url using an optional proxy server, retrying once on any error.
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 returning the name of the temp file.
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, LocalPath, 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.