file

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src string, dest string) error

Copy duplicates a file from one location to another. The location can be local or remote.

func CreateTempDirectory

func CreateTempDirectory() (string, func(), error)

CreateTempDirectory creates a temporary empty directory.

func CreateTempFile

func CreateTempFile() (string, func(), error)

CreateTempFile creates a temporary empty file.

func CreateTempFileWithContents

func CreateTempFileWithContents(content []byte) (string, func(), error)

CreateTempFileWithContents creates a temporary file with the contents specified.

func CreateTempFileWithExtension

func CreateTempFileWithExtension(fileExtension string) (string, func(), error)

CreateTempFileWithExtension creates a file with the fileExtension in a random temp directory.

func EnsureLocal

func EnsureLocal(fileReference string) (string, error)

EnsureLocal ensures that the file is downloaded locally and returns a read-only view of the file.

func Exists

func Exists(name string) bool

Exists returns true if the input file exists in the filesystem.

func GetBaseTempDirectory

func GetBaseTempDirectory() string

GetBaseTempDirectory gets the base temp directory.

func GetExtension

func GetExtension(fileReference string) string

GetExtension gets the file extension of the file reference.

func Sha256String

func Sha256String(localPath string) (string, error)

Sha256String returns the SHA-256 hash of a file.

func Sha512String

func Sha512String(localPath string) (string, error)

Sha512String returns the SHA-512 hash of a file.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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