util

package
v0.0.0-...-abb5ba4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirExists

func EnsureDirExists(dir string) (bool, error)

EnsureDirExists on disk

func FindIP

func FindIP(iface net.Interface) (string, error)

FindIP returns the IP address of the passed interface, and an error

func GetAddress

func GetAddress(cfg *config.Config) (string, error)

GetAddress returns the address of the network interface to bind the server to. The first time is run it prompts a dialog to choose which network interface should be used for the transfer

func GetRandomURLPath

func GetRandomURLPath() string

GetRandomURLPath returns a random string of 4 alphanumeric characters

func GetSessionID

func GetSessionID() (string, error)

GetSessionID returns a base64 encoded string of 40 random characters

func HumanReadableSizeOf

func HumanReadableSizeOf(pathToFile string) string

HumanReadableSizeOf returns size of the file in human-readable form

func ReadFilenames

func ReadFilenames(dir string) []string

ReadFilenames from dir

func ShouldBeZipped

func ShouldBeZipped(args []string) (bool, error)

ShouldBeZipped returns a boolean value indicating if the content should be zipped or not, and an error. The content should be zipped if: 1. the user passed the `-zip` flag 2. there are more than one file 3. the file is a directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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