Documentation ¶
Overview ¶
Package pkg provides the features to interal and external users. All CLI related logics should not be in this package.
Index ¶
- Constants
- func DownloadFileWithMultipleThread(targetURL, targetFilePath string, thread int, showProgress bool) (err error)
- func DownloadFileWithMultipleThreadKeepParts(targetURL, targetFilePath string, thread int, keepParts, showProgress bool) (err error)
- func DownloadWithContinue(targetURL, output string, index, continueAt, end int64, showProgress bool) (err error)
- func ErrorWrap(err error, format string, a ...any) error
- type DownloadError
- type HTTPDownloader
- type ProgressIndicator
- type ReleaseAsset
- type ReleaseClient
- func (g *ReleaseClient) GetJCLIAsset(tagName string) (*ReleaseAsset, error)
- func (g *ReleaseClient) GetLatestAsset(acceptPreRelease bool) (*ReleaseAsset, error)
- func (g *ReleaseClient) GetLatestJCLIAsset() (*ReleaseAsset, error)
- func (g *ReleaseClient) GetLatestPreReleaseAsset(owner, repo string) (ra *ReleaseAsset, err error)
- func (g *ReleaseClient) GetLatestReleaseAsset(owner, repo string) (ra *ReleaseAsset, err error)
- func (g *ReleaseClient) GetReleaseAssetByTagName(owner, repo, tagName string) (ra *ReleaseAsset, err error)
- func (g *ReleaseClient) Init()
- func (g *ReleaseClient) ListReleases(owner, repo string, count int) (list []ReleaseAsset, err error)
Constants ¶
const ( // ContentType is for the http header of content type ContentType = net.ContentType // ApplicationForm is for the form submit ApplicationForm = net.ApplicationForm )
Variables ¶
This section is empty.
Functions ¶
func DownloadFileWithMultipleThread ¶ added in v0.0.6
func DownloadFileWithMultipleThread(targetURL, targetFilePath string, thread int, showProgress bool) (err error)
DownloadFileWithMultipleThread downloads the files with multiple threads
func DownloadFileWithMultipleThreadKeepParts ¶ added in v0.0.8
func DownloadFileWithMultipleThreadKeepParts(targetURL, targetFilePath string, thread int, keepParts, showProgress bool) (err error)
DownloadFileWithMultipleThreadKeepParts downloads the files with multiple threads deprecated
Types ¶
type DownloadError ¶
type DownloadError net.DownloadError
DownloadError represents the error of HTTP download
type HTTPDownloader ¶
type HTTPDownloader net.HTTPDownloader
HTTPDownloader is the downloader for http request
func (*HTTPDownloader) DownloadFile ¶
func (h *HTTPDownloader) DownloadFile() error
DownloadFile download a file with the progress deprecated
type ProgressIndicator ¶
type ProgressIndicator net.ProgressIndicator
ProgressIndicator hold the progress of io operation
func (*ProgressIndicator) Init ¶
func (i *ProgressIndicator) Init()
Init set the default value for progress indicator
type ReleaseAsset ¶ added in v0.0.11
ReleaseAsset is the asset from GitHub release
type ReleaseClient ¶ added in v0.0.11
type ReleaseClient struct { Client *github.Client Org string Repo string // contains filtered or unexported fields }
ReleaseClient is the client of jcli github
func (*ReleaseClient) GetJCLIAsset ¶ added in v0.0.11
func (g *ReleaseClient) GetJCLIAsset(tagName string) (*ReleaseAsset, error)
GetJCLIAsset returns the asset from a tag name
func (*ReleaseClient) GetLatestAsset ¶ added in v0.0.26
func (g *ReleaseClient) GetLatestAsset(acceptPreRelease bool) (*ReleaseAsset, error)
GetLatestAsset returns the latest release asset which can accept preRelease or not
func (*ReleaseClient) GetLatestJCLIAsset ¶ added in v0.0.11
func (g *ReleaseClient) GetLatestJCLIAsset() (*ReleaseAsset, error)
GetLatestJCLIAsset returns the latest jcli asset deprecated, please use GetLatestAsset instead
func (*ReleaseClient) GetLatestPreReleaseAsset ¶ added in v0.0.26
func (g *ReleaseClient) GetLatestPreReleaseAsset(owner, repo string) (ra *ReleaseAsset, err error)
GetLatestPreReleaseAsset returns the release asset that could be preRelease
func (*ReleaseClient) GetLatestReleaseAsset ¶ added in v0.0.11
func (g *ReleaseClient) GetLatestReleaseAsset(owner, repo string) (ra *ReleaseAsset, err error)
GetLatestReleaseAsset returns the latest release asset
func (*ReleaseClient) GetReleaseAssetByTagName ¶ added in v0.0.11
func (g *ReleaseClient) GetReleaseAssetByTagName(owner, repo, tagName string) (ra *ReleaseAsset, err error)
GetReleaseAssetByTagName returns the release asset by tag name
func (*ReleaseClient) Init ¶ added in v0.0.11
func (g *ReleaseClient) Init()
Init init the GitHub client
func (*ReleaseClient) ListReleases ¶ added in v0.0.39
func (g *ReleaseClient) ListReleases(owner, repo string, count int) (list []ReleaseAsset, err error)
ListReleases returns the release list
Directories ¶
Path | Synopsis |
---|---|
Package common provides some common functions for the whole project.
|
Package common provides some common functions for the whole project. |
Package compress provides the compress and uncompress functions.
|
Package compress provides the compress and uncompress functions. |
Package installer is the core part of the software package installation.
|
Package installer is the core part of the software package installation. |
Package log provides the core logger functions.
|
Package log provides the core logger functions. |
Package net provides the core download functions
|
Package net provides the core download functions |
Package os provides a generic installer for all platforms.
|
Package os provides a generic installer for all platforms. |
apk
Package apk provides the common functions to install a package via apk.
|
Package apk provides the common functions to install a package via apk. |
apt
Package apt provides the common functions to install a package via apt.
|
Package apt provides the common functions to install a package via apt. |
brew
Package brew provides the common functions to install a package via brew.
|
Package brew provides the common functions to install a package via brew. |
core
Package core provides the core structs about the os-related package manager.
|
Package core provides the core structs about the os-related package manager. |
dnf
Package dnf provides the common function of dnf package manager.
|
Package dnf provides the common function of dnf package manager. |
docker
Package docker provides the way to install a package via docker CLI.
|
Package docker provides the way to install a package via docker CLI. |
fake
Package fake provides functions for unit test.
|
Package fake provides functions for unit test. |
generic
Package generic provides the generic packge installation.
|
Package generic provides the generic packge installation. |
npm
Package npm provides the common usage of npm.
|
Package npm provides the common usage of npm. |
scoop
Package scoop implements the scoop integration
|
Package scoop implements the scoop integration |
snap
Package snap provides the common usage of snap package manager.
|
Package snap provides the common usage of snap package manager. |
winget
Package winget implements the winget integration
|
Package winget implements the winget integration |
yum
Package yum provides the common usage of yum package manager.
|
Package yum provides the common usage of yum package manager. |
Package version provides the functions which related to version parse.
|
Package version provides the functions which related to version parse. |