file

package
v3.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package file

Package file

Package file

Package file

Package file

Package file

Package file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfoSha512

type InfoSha512 struct {
	Name   string // Название файла
	Size   int64  // Размер файла
	Sha512 string // Контрольная сумма файла
}

InfoSha512 Структура возвращаемой информации о файле

type Interface

type Interface interface {
	// CleanEmptyFolder Удаление пустых папок.
	CleanEmptyFolder(folderPath string) (err error)

	// Copy Копирует один файл в другой.
	Copy(dst string, src string) (size int64, err error)

	// CopyWithSha512Sum Копирование контента с параллельным вычислением контрольной суммы алгоритмом SHA512.
	CopyWithSha512Sum(dst io.Writer, src io.Reader) (written int64, sha512sum string, err error)

	// GetInfoSha512 Считывание информации о файле с контрольной суммой.
	GetInfoSha512(filename string) (inf *InfoSha512, err error)

	// RecursiveFileList Поиск всех файлов начиная от folderPath рекурсивно.
	// Возвращается слайс относительных имён файлов.
	RecursiveFileList(folderPath string) (ret []string, err error)

	// GetFilename Выделение из полного пути к файлу, имени файла.
	GetFilename(filename string) (ret string)

	// LoadFile Загрузка файла в память и возврат в виде *bytes.Buffer.
	LoadFile(filename string) (data *bytes.Buffer, info os.FileInfo, err error)
}

Interface is an interface

func New

func New() Interface

New creates new object and return Interface

Jump to

Keyboard shortcuts

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