fileutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileNameFromURL

func GetFileNameFromURL(resourceURL string) string

GetFileNameFromURL returns a string generated from the provided URL, that can be used as a file name. returns a string that contains the file name and an error if any error occurs.

func ReadUniqueFileLines

func ReadUniqueFileLines(fname string) ([]string, error)

ReadUniqueFileLines reads the content of the provided file, and returns a slice of strings that contains the unique lines, or an error if any error occurs.

func SaveFileToDisk

func SaveFileToDisk(outDirPath, outFileName string, fileContent []byte) error

SaveFileToDisk saves the file to disk, and creates the directory if it doesn't exist. The file is saved at the provided path with 0600 permission bits. It returns an error if any error occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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