util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Provides utility functions for common file operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSecretFileName

func GenerateSecretFileName(name string) string

GenerateSecretFileName generates a unique secret file name based on the MD5 hash and a random string.

func GetDecFileName

func GetDecFileName(file *os.File) string

GetDecFileName generates the decrypted file name by removing the ".age" extension.

func GetEncFileName

func GetEncFileName(file *os.File) string

GetEncFileName generates the encrypted file name with the ".age" extension.

func GetFileMode

func GetFileMode(file *os.File) fs.FileMode

GetFileMode returns the mode of the specified file.

func GetFileSize

func GetFileSize(file *os.File) int

GetFileSize returns the size of the specified file.

func GetFilesInDirectory

func GetFilesInDirectory(dir string) ([]string, error)

GetFilesInDirectory returns a slice containing the paths of all files in the specified directory.

func GetMd5Sum

func GetMd5Sum(name string) string

GetMd5Sum calculates the MD5 hash sum of the specified file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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