Documentation
¶
Overview ¶
Package files implements utility routines for gathering information about files and their contents.
Index ¶
- func ConvertToMapOfFiles(files []*mpi.File) map[string]*mpi.File
- func FileMeta(filePath string) (*mpi.FileMeta, error)
- func FileMetaWithCertificate(filePath string) (*mpi.FileMeta, error)
- func FileMode(mode string) os.FileMode
- func GenerateConfigVersion(fileSlice []*mpi.File) string
- func GenerateHash(b []byte) string
- func Permissions(fileMode os.FileMode) string
- func RecvChunkedFile(src grpc.ServerStreamingClient[v1.FileDataChunk], dst io.Writer) (header *v1.FileMeta, err error)
- func SendChunkedFile(meta *v1.MessageMeta, header v1.FileDataChunk_Header, src io.Reader, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToMapOfFiles ¶
ConvertToMapOfFiles converts a list of files to a map of files with the file name as the key
func FileMetaWithCertificate ¶
FileMetaWithCertificate returns a FileMeta struct with certificate metadata if applicable.
func GenerateConfigVersion ¶
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 ¶
GenerateHash returns the hash value of a file's contents.
func Permissions ¶
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.