fileutils

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package fileutils provides utility functions for commonmeta.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile added in v0.19.3

func DownloadFile(url string, filename string) error

DownloadFile downloads content from the given URL and saves it as a file.

func GetExtension added in v0.18.0

func GetExtension(filename string, ext string) (string, string, bool)

GetExtension extracts the file extension and checks if the output file should be zipped.

func ReadFile

func ReadFile(filename string) ([]byte, error)

func ReadZIPFile

func ReadZIPFile(filename string, name string) ([]byte, error)

ReadZIPFile opens a zip archive for reading

func UnzipContent added in v0.19.3

func UnzipContent(input []byte, filename string) ([]byte, error)

UnzipContent extracts the content from a zip archive, optionally only extract the content with filename

func WriteFile

func WriteFile(filename string, output []byte) error

WriteFile saves content as a file.

func WriteZIPFile

func WriteZIPFile(filename string, output []byte) error

WriteZIPFile saves content as a zip file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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