privlib

package
v0.0.0-...-e61429f Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCreateFolder

func CheckCreateFolder(outputFolder string) string

CheckCreateFolder Given a destination automatically create a folder if it doesn't exist and return path of that folder

func FileDownload

func FileDownload(filename, url, token string)

FileDownload Given a filename and url, this method will attempt to download a file to a given named location

func ParseJSON

func ParseJSON(jsonText io.Reader, thisStruct interface{})

ParseJSON will attempt to parse an io.Reader and place it on a passed interface{}

func PasswordCreator

func PasswordCreator(password string) string

PasswordCreator will encrypt a new password giving a base64 version of the ciphertext:key

func PasswordDecryptor

func PasswordDecryptor(secret64 string) string

PasswordDecryptor will accept a base64 string of ciphertext:key and decrypt to plain text

Types

type WriteCounter

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

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (*WriteCounter) Finish

func (wc *WriteCounter) Finish()

Finish finishes the timer of writing the file

func (*WriteCounter) Start

func (wc *WriteCounter) Start()

Start starts the timer of writing the file

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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