util

package
v0.0.0-...-3c7e412 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadUrl

func DownloadUrl(id string) string

Note to self: file.WebContentLink = https://docs.google.com/uc?id=<id>&export=download

func FileExists

func FileExists(path string) bool

Returns true if file/directory exists

func FileSizeFormat

func FileSizeFormat(bytes int64, forceBytes bool) string

func FormatBool

func FormatBool(b bool) string

func Homedir

func Homedir() string

Returns the users home dir

func ISODateToLocal

func ISODateToLocal(iso string) string

func InternalDownloadUrlAndExtension

func InternalDownloadUrlAndExtension(info *drive.File, format string) (downloadUrl string, extension string, err error)

func MeasureTransferRate

func MeasureTransferRate() func(int64) string

func Mkdir

func Mkdir(path string) error

func ParentList

func ParentList(parents []*drive.ParentReference) string

func PreviewUrl

func PreviewUrl(id string) string

func Print

func Print(m map[string]string, keyOrder []string)

Prints a map in the provided order with one key-value-pair per line

func PrintColumns

func PrintColumns(items []map[string]string, keyOrder []string, columnSpacing int, noHeader bool)

Prints items in columns with header and correct padding

func Prompt

func Prompt(msg string) string

Prompt user to input data

func TruncateString

func TruncateString(str string, maxRunes int) string

Truncates string to given max length, and inserts ellipsis into the middle of the string to signify that the string has been truncated

Types

This section is empty.

Jump to

Keyboard shortcuts

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