Documentation
¶
Overview ¶
Package fileutils provides utility functions for commonmeta.
Index ¶
- func DownloadFile(url string, progress bool) ([]byte, error)
- func GetExtension(filename string, ext string) (string, string, string)
- func ReadFile(filename string) ([]byte, error)
- func ReadGZFile(filename string) ([]byte, error)
- func ReadZIPFile(filename string, name string) ([]byte, error)
- func UncompressContent(input []byte) ([]byte, error)
- func UnzipContent(input []byte, filename string) ([]byte, error)
- func WriteFile(filename string, output []byte) error
- func WriteGZFile(filename string, output []byte) error
- func WriteZIPFile(filename string, output []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶ added in v0.19.3
DownloadFile downloads content from the given URL.
func GetExtension ¶ added in v0.18.0
GetExtension extracts the file extension and checks if the output file should be compressed.
func ReadGZFile ¶ added in v0.25.0
ReadGZFile opens a gz archive for reading
func ReadZIPFile ¶
ReadZIPFile opens a zip archive for reading
func UncompressContent ¶ added in v0.25.0
UncompressContent extracts the content from a gz archive,
func UnzipContent ¶ added in v0.19.3
UnzipContent extracts the content from a zip archive, optionally only extract the content with filename
func WriteGZFile ¶ added in v0.25.0
WriteGZFile saves content as a gz file.
func WriteZIPFile ¶
WriteZIPFile saves content as a zip file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.