files

package
v3.0.0-...-0f0c0e2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package files implements utility routines for gathering information about files and their contents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToMapOfFiles

func ConvertToMapOfFiles(files []*mpi.File) map[string]*mpi.File

ConvertToMapOfFiles converts a list of files to a map of files with the file name as the key

func FileMeta

func FileMeta(filePath string) (*mpi.FileMeta, error)

FileMeta returns a proto FileMeta struct from a given file path.

func FileMetaWithCertificate

func FileMetaWithCertificate(filePath string) (*mpi.FileMeta, error)

FileMetaWithCertificate returns a FileMeta struct with certificate metadata if applicable.

func FileMode

func FileMode(mode string) os.FileMode

func GenerateConfigVersion

func GenerateConfigVersion(fileSlice []*mpi.File) string

GenerateConfigVersion returns a unique config version for a set of files. The config version is calculated by joining the file hashes together and generating a unique ID.

func GenerateHash

func GenerateHash(b []byte) string

GenerateHash returns the hash value of a file's contents.

func Permissions

func Permissions(fileMode os.FileMode) string

Permissions returns a file's permissions as a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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