cmd_utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableAuthCheck

func DisableAuthCheck(cmd *cobra.Command)

func DownloadFileThroughUrl

func DownloadFileThroughUrl(file string, downloadUrl string)

DownloadFileThroughUrl downloads a single file from the given downloadUrl. file is the absolute path of the file to be downloaded. downloadUrl is the pre-signed url to download the file from.

func IsAuthCheckEnabled

func IsAuthCheckEnabled(cmd *cobra.Command) bool

func NewTransport added in v1.1.0

func NewTransport(timeout time.Duration) *http.Transport

Types

type Progress

type Progress struct {
	PrintPrefix string
	TotalSize   int64
	BytesRead   int64
}

Progress is a simple struct to keep track of the progress of a file upload/download

func (*Progress) Print

func (pr *Progress) Print()

Print displays the current progress of the file upload each time Write is called

func (*Progress) Write

func (pr *Progress) Write(p []byte) (n int, err error)

Write is used to satisfy the io.Writer interface. Instead of writing somewhere, it simply aggregates the total bytes on each read

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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