mrfilestorage

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPath = mrerr.NewProto(
	"errMrFileStorageInvalidPath", mrerr.ErrorKindInternal, "invalid path '{{ .path }}'")

ErrInvalidPath - invalid path.

Functions

This section is empty.

Types

type FileProvider added in v0.6.8

type FileProvider struct {
	// contains filtered or unexported fields
}

FileProvider - файловый провайдер, работающий с нативной файловой системой, позволяет читать, сохранять, удалять файлы.

func NewFileProvider added in v0.6.8

func NewFileProvider(fs *FileSystem, rootDir string) *FileProvider

NewFileProvider - создаёт объект FileProvider.

func (*FileProvider) Close added in v0.13.0

func (fp *FileProvider) Close() error

Close - закрывает текущее соединение.

func (*FileProvider) Download added in v0.6.8

func (fp *FileProvider) Download(ctx context.Context, filePath string) (mrtype.File, error)

Download - comment method.

func (*FileProvider) DownloadFile added in v0.7.0

func (fp *FileProvider) DownloadFile(ctx context.Context, filePath string) (io.ReadCloser, error)

DownloadFile - comment method.

func (*FileProvider) Info added in v0.6.8

func (fp *FileProvider) Info(ctx context.Context, filePath string) (mrtype.FileInfo, error)

Info - comment method.

func (*FileProvider) Ping added in v0.13.0

func (fp *FileProvider) Ping(ctx context.Context) error

Ping - проверяет возможность работы с файлами.

func (*FileProvider) Remove added in v0.6.8

func (fp *FileProvider) Remove(ctx context.Context, filePath string) error

Remove - comment method.

func (*FileProvider) Upload added in v0.6.8

func (fp *FileProvider) Upload(ctx context.Context, file mrtype.File) error

Upload - comment method.

type FileSystem added in v0.6.8

type FileSystem struct {
	// contains filtered or unexported fields
}

FileSystem - объект для работы с файлами проекта.

func New

func New(dirMode os.FileMode, createDirs bool, mimeTypes *mrlib.MimeTypeList) *FileSystem

New - создаёт объект FileSystem.

func (*FileSystem) CreateDirIfNotExists added in v0.6.8

func (f *FileSystem) CreateDirIfNotExists(rootDir, dirPath string) error

CreateDirIfNotExists - comment method.

func (*FileSystem) InitRootDir added in v0.6.8

func (f *FileSystem) InitRootDir(path string) (bool, error)

InitRootDir - comment method.

func (*FileSystem) MimeTypes added in v0.11.0

func (f *FileSystem) MimeTypes() *mrlib.MimeTypeList

MimeTypes - comment method.

Jump to

Keyboard shortcuts

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