Documentation ¶
Overview ¶
Package toolbox is the top level package for a collection of utility packages.
Index ¶
Constants ¶
const ( MacOS = "darwin" WindowsOS = "windows" LinuxOS = "linux" )
Constants for comparison to runtime.GOOS
Variables ¶
This section is empty.
Functions ¶
func AppDir ¶
AppDir returns the logical directory the application resides within. For macOS, this means the directory where the .app bundle resides, not the binary that's tucked down inside it.
func Call ¶
func Call(f func())
Call the provided function, safely wrapped in a errs.Recovery() handler that logs any errors via slog.
func CallWithHandler ¶
func CallWithHandler(f func(), errHandler func(err error))
CallWithHandler calls the provided function, safely wrapped in a errs.Recovery() handler.
func CurrentUserName ¶
func CurrentUserName() string
CurrentUserName returns the current user's name. This will attempt to retrieve the user's display name, but will fall back to the account name if it isn't available.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package atexit provides functionality similar to the C standard library's atexit() call.
|
Package atexit provides functionality similar to the C standard library's atexit() call. |
Package cmdline provides command line option handling.
|
Package cmdline provides command line option handling. |
Package desktop provides desktop integration utilities.
|
Package desktop provides desktop integration utilities. |
Package errs implements a detailed error object that provides stack traces with source locations, along with nested causes, if any.
|
Package errs implements a detailed error object that provides stack traces with source locations, along with nested causes, if any. |
formats
|
|
json
Package json provides manipulation of JSON data.
|
Package json provides manipulation of JSON data. |
xlsx
Package xlsx provides the ability to extract text from Excel spreadsheets.
|
Package xlsx provides the ability to extract text from Excel spreadsheets. |
log
|
|
jot
Package jot provides simple asynchronous logging.
|
Package jot provides simple asynchronous logging. |
jotrotate
Package jotrotate provides a pre-canned way to add jot logging with file rotation, along with command-line options for controlling it.
|
Package jotrotate provides a pre-canned way to add jot logging with file rotation, along with command-line options for controlling it. |
logadapter
Package logadapter defines an API to use for logging, which actual logging implementations can implement directly or provide an adapter to use.
|
Package logadapter defines an API to use for logging, which actual logging implementations can implement directly or provide an adapter to use. |
rotation
Package rotation provides file rotation when files hit a given size.
|
Package rotation provides file rotation when files hit a given size. |
Package rate provides rate limiting which supports a hierarchy of limiters, each capped by their parent.
|
Package rate provides rate limiting which supports a hierarchy of limiters, each capped by their parent. |
Package taskqueue provides a simple asynchronous task queue.
|
Package taskqueue provides a simple asynchronous task queue. |
Package txt provides various text utilities.
|
Package txt provides various text utilities. |
vcs
|
|
git
Package git provides simple git repository access.
|
Package git provides simple git repository access. |
Package xio provides i/o utilities.
|
Package xio provides i/o utilities. |
fs
Package fs provides filesystem-related utilities.
|
Package fs provides filesystem-related utilities. |
fs/paths
Package paths provides platform-specific standard paths.
|
Package paths provides platform-specific standard paths. |
fs/safe
Package safe provides safe, atomic saving of files.
|
Package safe provides safe, atomic saving of files. |
fs/tar
Package tar provides simple tar extraction.
|
Package tar provides simple tar extraction. |
fs/zip
Package zip provides simple zip extraction.
|
Package zip provides simple zip extraction. |
network
Package network provides network-related utilities.
|
Package network provides network-related utilities. |
network/natpmp
Package natpmp provides an implementation of NAT-PMP.
|
Package natpmp provides an implementation of NAT-PMP. |
network/xhttp
Package xhttp provides HTTP-related utilities.
|
Package xhttp provides HTTP-related utilities. |
network/xhttp/web
Package web provides a web server with some standardized logging and handler wrapping.
|
Package web provides a web server with some standardized logging and handler wrapping. |
term
Package term provides terminal utilities.
|
Package term provides terminal utilities. |
Package xmath provides math-related utilities.
|
Package xmath provides math-related utilities. |
geom
Package geom provides geometry primitives.
|
Package geom provides geometry primitives. |
rand
Package rand provides a Randomizer based upon the crypto/rand package.
|
Package rand provides a Randomizer based upon the crypto/rand package. |