files

package
v3.12.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func RecvChunkedFile

func RecvChunkedFile(
	src grpc.ServerStreamingClient[v1.FileDataChunk],
	dst io.Writer,
) (header *v1.FileMeta, err error)

RecvChunkedFile receives [FileDataChunkContent]s from the stream and writes the file contents to the dst.

func SendChunkedFile

func SendChunkedFile(
	meta *v1.MessageMeta,
	header v1.FileDataChunk_Header,
	src io.Reader,
	dst grpc.ServerStreamingServer[v1.FileDataChunk],
) error

SendChunkedFile reads the src into [FileDataChunkContent]s, and sends a valid sequence of [FileDataChunk]s down the stream.

Types

This section is empty.

Jump to

Keyboard shortcuts

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