pkg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJCLIPluginPath

func GetJCLIPluginPath(userHome, name string, binary bool) string

GetJCLIPluginPath returns the path of a jcli plugin

func LoadPlugins

func LoadPlugins(cmd *cobra.Command)

LoadPlugins loads the plugins

func SetProxy

func SetProxy(proxy, proxyAuth string, tr *http.Transport) (err error)

SetProxy set the proxy for a http

Types

type HTTPDownloader

type HTTPDownloader struct {
	TargetFilePath     string
	URL                string
	ShowProgress       bool
	InsecureSkipVerify bool

	UserName string
	Password string

	Proxy     string
	ProxyAuth string

	Debug        bool
	RoundTripper http.RoundTripper
}

HTTPDownloader is the downloader for http request

func (*HTTPDownloader) DownloadFile

func (h *HTTPDownloader) DownloadFile() error

DownloadFile download a file with the progress

type Plugin

type Plugin struct {
	Use          string `yaml:"use"`
	Short        string
	Long         string
	Main         string
	Version      string
	DownloadLink string `yaml:"downloadLink"`
	Installed    bool
}

func FindPlugins

func FindPlugins() (plugins []Plugin, err error)

type PluginError

type PluginError struct {
	// contains filtered or unexported fields
}

type ProgressIndicator

type ProgressIndicator struct {
	Writer io.Writer
	Reader io.Reader
	Title  string

	// bytes.Buffer
	Total float64
	// contains filtered or unexported fields
}

ProgressIndicator hold the progress of io operation

func (*ProgressIndicator) Init

func (i *ProgressIndicator) Init()

Init set the default value for progress indicator

func (*ProgressIndicator) Read

func (i *ProgressIndicator) Read(p []byte) (n int, err error)

Read reads the progress

func (*ProgressIndicator) Write

func (i *ProgressIndicator) Write(p []byte) (n int, err error)

Write writes the progress

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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