util

package
v0.0.0-...-8b35ad8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(input string) string

Expand tilde in paths

func FindIP

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

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

func GetExternalIP

func GetExternalIP() (net.IP, error)

GetExternalIP of this host

func GetInterfaceAddress

func GetInterfaceAddress(ifaceString string) (string, error)

GetInterfaceAddress returns the address of the network interface to bind the server to. If the interface is "any", it will return 0.0.0.0. If no interface is found with that name, an error is returned

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 Interfaces

func Interfaces(listAll bool) (map[string]string, error)

Interfaces returns a `name:ip` map of the suitable interfaces found

func ReadFilenames

func ReadFilenames(dir string) []string

ReadFilenames from dir

func ZipFiles

func ZipFiles(files []string) (string, error)

ZipFiles and return the resulting zip's filename

Types

This section is empty.

Jump to

Keyboard shortcuts

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