mrfilestorage

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type FileProvider added in v0.6.8

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

func NewFileProvider added in v0.6.8

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

func (*FileProvider) Download added in v0.6.8

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

func (*FileProvider) DownloadFile added in v0.7.0

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

func (*FileProvider) Info added in v0.6.8

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

func (*FileProvider) Remove added in v0.6.8

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

func (*FileProvider) Upload added in v0.6.8

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

type FileSystem added in v0.6.8

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

func New

func New(opt Options) *FileSystem

func (*FileSystem) CreateDirIfNotExists added in v0.6.8

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

func (*FileSystem) InitRootDir added in v0.6.8

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

type Options added in v0.6.8

type Options struct {
	DirMode    os.FileMode
	CreateDirs bool
}

Jump to

Keyboard shortcuts

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