io

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package io provides functions for interfacing with input and output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileURI

func AddFileURI(hostname string, uri string) string

AddFileURI ensures the file:// prefix exists on a URI.

func CopyFile

func CopyFile(source string, destination string) error

CopyFile copies a file, overwriting if the destination exists.

func DirectoryExists

func DirectoryExists(path string) bool

DirectoryExists checks whether a directory exists.

func EnsureDirectory

func EnsureDirectory(uri string) error

EnsureDirectory ensures a directory exists.

func ExecuteWithTimeout

func ExecuteWithTimeout(timeout time.Duration, name string, args ...string) ([]byte, error)

ExecuteWithTimeout executes a command, killing it after too long.

func FileExists

func FileExists(path string) bool

FileExists checks whether a file exists.

func FileExistsInPath

func FileExistsInPath(fileName string) (bool, error)

FileExistsInPath checks whether a file exists anywhere in the system path.

func NormalizePathSeparators

func NormalizePathSeparators(input string) string

NormalizePathSeparators ensures that paths have correct slashes.

func ParseFileURI

func ParseFileURI(uri string) (string, string)

ParseFileURI removes the file:// prefix and returns the hostname and file paths from a URI.

func Remove

func Remove(uri string) error

Remove removes a file or directory.

func RemoveRecursive

func RemoveRecursive(uri string) error

RemoveRecursive removes a directory and its children, recursively.

func SanitizeDirectory

func SanitizeDirectory(input string) string

SanitizeDirectory ensures a directory path is safe.

Types

This section is empty.

Jump to

Keyboard shortcuts

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