fileutils

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 11 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, progress bool) ([]byte, error)

DownloadFile downloads content from the given URL.

func GetExtension added in v0.18.0

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

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

func ReadFile

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

func ReadGZFile added in v0.25.0

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

ReadGZFile opens a gz archive for reading

func ReadZIPFile

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

ReadZIPFile opens a zip archive for reading

func UncompressContent added in v0.25.0

func UncompressContent(input []byte) ([]byte, error)

UncompressContent extracts the content from a gz archive,

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 WriteGZFile added in v0.25.0

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

WriteGZFile saves content as a gz 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