http-downloader

command module
v0.0.94 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 3 Imported by: 0

README

Gitpod ready-to-code Codacy Badge Codacy Badge codecov Contributors GitHub release GitHub All Releases LinuxSuRen/open-source-best-practice

Get started

hd is a HTTP download tool.

Install it via: brew install linuxsuren/linuxsuren/hd

Or download it directly (for Linux):

curl https://linuxsuren.github.io/tools/install.sh|bash

Or download it via proxy:

curl https://gitee.com/linuxsuren/tools/raw/master/install-zh.sh|bash

for Windows users (you might need to add this program into the Windows Defence exclude list):

winget install 'HTTP downloader'

Want to go through the code? GitPod definitely can help you.

Usage

Download

hd get https://github.com/jenkins-zh/jenkins-cli/releases/latest/download/mde-linux-amd64.tar.gz --thread 6

Or use a simple way instead of typing the whole URL:

hd get mde

Or you might want to download a pre-released binary package from GitHub:

hd get --pre ks

Install

You can also install a package from GitHub:

#!title: Install mde with specific threads
hd install mde -t 6

or install by a category name:

hd install --category security

hd can download or install via the format of $org/$repo. If you find that it's not working. It might because of there's no record in hd-home. You're welcome to help us to maintain it.

When you first run it, please init via: hd fetch

then you can search it by a keyword: hd search jenkins

Use multi-stage builds

Do you want to download tools in the Docker builds? It's pretty easy. Please see the following example:

FROM ghcr.io/linuxsuren/hd:v0.0.42 as downloader
RUN hd install kubesphere-sigs/ks@v0.0.50

FROM alpine:3.10
COPY --from=downloader /usr/local/bin/ks /usr/local/bin/ks
CMD ["ks"]

As a library

You can import it from github.com/linuxsuren/http-downloader/pkg/installer, then put the following code to your CLI. It can help you to download desired tools:

is := installer.Installer{
    Provider: "github",
}
if err = is.CheckDepAndInstall(map[string]string{
    "ks": "linuxsuren/ks",
    "kk": "kubekey",
}); err != nil {
    return
}

Install other services

It supports to install other services, for example: bitbucket.

hd install bitbucket

Features

  • go library for HTTP
  • multi-thread
  • continuously (TODO)
  • GitHub release asset friendly

Release

This project can be released via linuxsuren-versions.

Visitor Count

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd provides the CLI commands
Package cmd provides the CLI commands
mock
mhttp
Package mhttp is a generated GoMock package.
Package mhttp is a generated GoMock package.
pkg
Package pkg provides the features to interal and external users.
Package pkg provides the features to interal and external users.
common
Package common provides some common functions for the whole project.
Package common provides some common functions for the whole project.
compress
Package compress provides the compress and uncompress functions.
Package compress provides the compress and uncompress functions.
installer
Package installer is the core part of the software package installation.
Package installer is the core part of the software package installation.
log
Package log provides the core logger functions.
Package log provides the core logger functions.
net
Package net provides the core download functions
Package net provides the core download functions
os
Package os provides a generic installer for all platforms.
Package os provides a generic installer for all platforms.
os/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.
os/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.
os/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.
os/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.
os/dnf
Package dnf provides the common function of dnf package manager.
Package dnf provides the common function of dnf package manager.
os/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.
os/fake
Package fake provides functions for unit test.
Package fake provides functions for unit test.
os/generic
Package generic provides the generic packge installation.
Package generic provides the generic packge installation.
os/npm
Package npm provides the common usage of npm.
Package npm provides the common usage of npm.
os/scoop
Package scoop implements the scoop integration
Package scoop implements the scoop integration
os/snap
Package snap provides the common usage of snap package manager.
Package snap provides the common usage of snap package manager.
os/winget
Package winget implements the winget integration
Package winget implements the winget integration
os/yum
Package yum provides the common usage of yum package manager.
Package yum provides the common usage of yum package manager.
version
Package version provides the functions which related to version parse.
Package version provides the functions which related to version parse.

Jump to

Keyboard shortcuts

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