file

package
v0.0.0-...-585f190 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader interface {
	Reader() (io.ReadCloser, error)
	Size() int64
	ModifyTime() int64
	Close() error
	ReadAt(p []byte, offset int64) (n int, err error)
	Name() string
}

func NewFileReader

func NewFileReader(path string) (FileReader, error)

type FileReaderImpl

type FileReaderImpl struct {
	*os.File
	// contains filtered or unexported fields
}

func (*FileReaderImpl) Close

func (f *FileReaderImpl) Close() error

func (*FileReaderImpl) ModifyTime

func (f *FileReaderImpl) ModifyTime() int64

func (*FileReaderImpl) Name

func (f *FileReaderImpl) Name() string

func (*FileReaderImpl) ReadAt

func (f *FileReaderImpl) ReadAt(p []byte, offset int64) (n int, err error)

func (*FileReaderImpl) Reader

func (f *FileReaderImpl) Reader() (io.ReadCloser, error)

func (*FileReaderImpl) Size

func (f *FileReaderImpl) Size() int64

type FileRepo

type FileRepo interface {
	// mysql
	UploadFile(ctx context.Context, files []*common.Files) error
	DeleteFile(ctx context.Context, files []*common.Files) error
	UpdateFile(ctx context.Context, files []*common.Files) error
	GetFile(ctx context.Context, uri string) (*common.Files, error)
	ListFile(ctx context.Context, name []string) ([]*common.Files, error)
}

type FileUsecase

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

func NewFileUsecase

func NewFileUsecase(config *config.Config) *FileUsecase

func (*FileUsecase) AbortMultipartUpload

func (*FileUsecase) CompleteMultipartUploadFile

func (f *FileUsecase) CompleteMultipartUploadFile(ctx context.Context, in *api.CompleteMultipartUploadRequest, authorId string) (*api.CompleteMultipartUploadResponse, error)

func (*FileUsecase) Delete

func (f *FileUsecase) Delete(ctx context.Context, in *api.DeleteRequest, authorId string) (*api.DeleteResponse, error)

func (*FileUsecase) Download

func (f *FileUsecase) Download(ctx context.Context, in *api.DownloadRequest, authorId string) ([]byte, error)

func (*FileUsecase) DownloadForRange

func (f *FileUsecase) DownloadForRange(ctx context.Context, in *api.DownloadRequest, start int64, end int64, authorId string) ([]byte, int64, error)

func (*FileUsecase) Metadata

func (*FileUsecase) Upload

Upload uploads a file.

The file is saved in the directory specified by the key.

The authorId is used to determine the directory which is as user's home dir where the file is saved.

func (*FileUsecase) UploadMultipartFileFile

func (*FileUsecase) Version

func (f *FileUsecase) Version(ctx context.Context, key, authorId string) (string, error)

type FileVersionReader

type FileVersionReader interface {
	FileReader
	Version() string
	Author() string
}

func NewFileVersionReader

func NewFileVersionReader(path string, version string) (FileVersionReader, error)

type ReaderAtCloser

type ReaderAtCloser struct {
	io.ReadCloser
}

Jump to

Keyboard shortcuts

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