net

package
v0.0.0-...-bc5e03d Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: AFL-3.0, CC-BY-3.0 Imports: 29 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncURL

func AsyncURL(url string, destFn string, opt *Params) error

AsyncURL can access URL via using external commandline tools including wget, curl, axel, git and rsync

func AsyncURL2

func AsyncURL2(url string, destFn string, opt *Params) error

AsyncURL2 can access URL via using golang http library (with mbp progress bar) and external commandline tools including wget, curl, axel, git and rsync

func AsyncURL3

func AsyncURL3(url string, destFn string, opt *Params) (err error)

AsyncURL3 can access URL via using golang http library (with mbp progress bar) and external commandline tools including wget, curl, axel, git and rsync

func Axel

func Axel(url string, destFn string, opt *Params) (err error)

Axel use axel to download files

func Curl

func Curl(url string, destFn string, opt *Params) (err error)

Curl use curl to download files

func Egafetch

func Egafetch(ega string, fileID string, outDir string, opt *Params) (err error)

Egafetch use pyega3 fetch EGA Archive files https://ega-archive.org/download/downloader-quickguide-v3#defineCredentials

func FormatURLfileName

func FormatURLfileName(url string, remoteName bool, timeout int, proxy string) (fname string)

func GdcClient

func GdcClient(fileID string, manifest string, outDir string, opt *Params) (err error)

GdcClient use gdc-client to download files

func Git

func Git(url string, destFn string, opt *Params) (err error)

Git use git to download files

func HTTPGetURL

func HTTPGetURL(url string, destFn string, opt *Params) error

HTTPGetURL can use golang http.Get to query URL with progress bar

func HTTPGetURLs

func HTTPGetURLs(urls []string, destDir []string, opt *Params) (destFns []string)

HTTPGetURLs can use golang http.Get and external commandline tools including wget, curl, axel, git and rsync to query URL with progress bar

func Hg

func Hg(url string, destFn string, opt *Params) (err error)

Hg use hg to download files

func NewHTTPClient

func NewHTTPClient(timeout int, proxy string) *http.Client

NewHTTPClient create http.Client with timeout, proxy, and gCurCookieJar

func ParseOutfnFromHeader

func ParseOutfnFromHeader(outfn string, resp *http.Response, useRemoteName bool) string

ParseOutfnFromHeader get filename from response header

func Prefetch

func Prefetch(srr string, krt string, outDir string, opt *Params) (err error)

Prefetch use sra-tools prefetch to download files

func RandProxy

func RandProxy(proxy string) (*neturl.URL, string)

RandProxy return a proxy from proxy string

func RetriesClient

func RetriesClient(client *http.Client, req *http.Request, opt *Params) (resp *http.Response, err error)

RetriesClient http.Client and requenst with retries

func RetriesTask

func RetriesTask(taskName string, cmd *exec.Cmd, logPath string, opt *Params) (err error)

RetriesTask task with retries

func RetriesURL

func RetriesURL(url string, cmd *exec.Cmd, logPath string, opt *Params) (err error)

RetriesURL access URL with retries

func Rsync

func Rsync(url string, destFn string, opt *Params) (err error)

Rsync use rsync to download files

func SetCmdProxyEnv

func SetCmdProxyEnv(cmd *exec.Cmd, proxy, url string)

SetCmdProxyEnv set downloader (shell tools) env

func SetCollyProxy

func SetCollyProxy(c *colly.Collector, pry string, timeout int)

SetCollyProxy set colly.Collector with proxy

func SetDefaultReqHeader

func SetDefaultReqHeader(req *http.Request)

SetDefaultReqHeader set default keep-alive and User-Agent header

func SetQueryFromEnd

func SetQueryFromEnd(from int, size int, total int) (int, int)

SetQueryFromEnd get from and end according to the from, size and total

func Wget

func Wget(url string, destFn string, opt *Params) (err error)

Wget use wget to download files

Types

type Params

type Params struct {
	// go-http, wget, curl, axel,
	Engine         string
	Token          string
	EgaCredentials string
	Mirror         string
	Thread         int
	ThreadQuery    int
	ExtraArgs      string
	Proxy          string
	TaskID         string
	Quiet          bool
	Overwrite      bool
	Ignore         bool
	LogDir         string
	SaveLog        bool
	Retries        int
	Timeout        int
	RetSleepTime   int
	RemoteName     bool
	Pbar           *mpb.Progress
}

Params is the type object to run bioctl net function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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