package
0.0.0-20240627150858-f50264a9cb12
Repository: https://github.com/aptrust/dart-runner.git
Documentation: pkg.go.dev

# Functions

Add adds a to b and returns the result.
No description provided by the author
No description provided by the author
CleanBagName returns the clean bag name.
ContainsControlCharacter returns true if string str contains a Unicode control character.
ContainsEscapedControl returns true if string str contains something that looks like an escaped UTF-8 control character.
CopyFile copies a file from src to dest.
CopyMap returns a copy of map orig.
DateISO returns a date in format "2006-01-02".
DateTimeISO returns a date in format "2006-01-02T15:04:05Z".
DateUS returns a date in format "Jan 2, 2006 15:04:05".
DateUS returns a date in format "Jan 2, 2006".
Dict returns an interface map suitable for passing into sub templates.
DirStats returns stats about a directory.
DisplayDate returns a datetime in human-readable format.
EscapeAttr escapes an HTML attribute value.
EscapeHTML returns an escaped HTML string.
EstimatedChunkSize returns the size we should use for each chunk in a multipart S3 upload.
ExecCommand executes a command and returns the output of STDOUT and STDERR as well as the exit code.
Expands the tilde in a directory path to the current user's home directory.
Returns true if the file at path exists, false if not.
FileIconFor returns a FontAwesome icon for the specified file type, as defined in util.FileIconMap.
FindCommonPrefix finds the common prefix in a list of strings.
GetDirectoryStats returns the file count, directory count and total number of bytes found recursively under directory dir.
No description provided by the author
No description provided by the author
GetWindowsDrives returns a list of Windows drives.
No description provided by the author
HumanSize returns a number of bytes in a human-readable format.
IntListContains returns true if list contains item.
Returns true if path is a directory.
IsEmpty returns true if string s is empty.
IsEmptyStringList returns true if list contains no items or if all items in list are empty strings.
IsListType returns true if obj is a slice or array.
IsMapType returns true if obj is a map.
ListDirectory returns a list of directory contents one level deep.
ListDirectoriesWithSort returns a list of all items in the specified directory, showing folders first, then files.
LooksLikeHypertextURL returns true if str looks like an HTTP or HTTPS URL.
No description provided by the author
No description provided by the author
No description provided by the author
LooksLikeURL returns true if url looks like a URL.
LooksLikeUUID returns true if uuid looks like a valid UUID.
Returns true if the path specified by dir has at least minLength characters and at least minSeparators path separators.
Paths in pastbuild_test_batch.csv file are relative.
Min returns the minimum of x or y without all the casting required by the math package.
Mod returns true of a modulus b equals zero.
NewExtendedFileInfo creates a new ExtendedFileInfo object.
NewLine returns the correct newline character for the current system, either "\r\n" or "\n".
No description provided by the author
NewPaths returns a Paths struct appropriate to the current operating system.
ParseCSV parses the CSV file at pathToCSVFile and returns the following: 1.
PathTo returns the path to the specified program.
PathToTestData returns the path to the directory containing test data.
No description provided by the author
PrintAndExit prints a message to STDERR and exits.
ProjectRoot returns the project root.
ReadFile reads an entire file into a byte array.
RecursiveFileList a list of all items inside of dir.
RemoveFromSlice removes the item at index index from slice, returning a new slice.
RunningInCI returns true when code is running in the Travis CI environment.
SetBoolValue sets the value of obj.fieldName to value.
SetFloatValue sets the value of obj.fieldName to value.
SetIntValue sets the value of obj.fieldName to value.
SetStringValue sets the value of obj.fieldName to value.
SlitAndTrim splits string s on the specified separator, then trims leading and trailing whitespace from each item in the resulting slice.
StrEq compares the string representation of two values and returns true if they are equal.
StringIsShellSafe returns true if string looks safe to pass to shell.
StringListContains returns true if the list of strings contains item.
StringListContainsAll returns true if all items in listToCheck are also in masterList.
StringToBool converts a string to its boolean value, or returns an error if it can't convert the string.
StripFileExtension returns filename, minus the extension.
StripNonPrintable returns a copy of str with non-printable characters removed.
StrStartsWith returns true if string s starts with the specified prefix.
TarPathToBagPath, given the path of a file inside a tarball, returns the path of the file in a bag.
TestsAreRunning returns true when code is running under "go test".
ToHumanSize converts a raw byte count (size) to a human-friendly representation.
Truncate truncates the value to the given length, appending an ellipses to the end.
TruncateMiddle trims str to maxLen by removing them from the middle of the string.
TruncateStart trims str to maxLen by removing them from the start of the string.
UCFirst returns string str with the first letter capitalized and all others lower case.
UnixToISO converts a Unix timestamp to ISO format.
YesNo returns "Yes" if value is true, "No" if value is false.
YesOrNo returns "Yes" if value is true, "No" if value is false.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

FileIconMap maps strings to font awesome icons.
MultipartSuffix pattern describes what APTrust's multipart bag suffix looks like.
TarSuffix matches strings that end with .tar.

# Structs

No description provided by the author
ExtendedFileInfo adds some data to os.FileInfo including FullPath, Owner() and Group().
NameValuePair contains a name and value.
No description provided by the author
Paths contains paths to common directories used by DART.