Documentation ¶
Index ¶
- type FileReader
- type FileReaderImpl
- type FileRepo
- type FileUsecase
- func (f *FileUsecase) AbortMultipartUpload(ctx context.Context, in *api.AbortMultipartUploadRequest) (*api.AbortMultipartUploadResponse, error)
- func (f *FileUsecase) CompleteMultipartUploadFile(ctx context.Context, in *api.CompleteMultipartUploadRequest, authorId string) (*api.CompleteMultipartUploadResponse, error)
- func (f *FileUsecase) Delete(ctx context.Context, in *api.DeleteRequest, authorId string) (*api.DeleteResponse, error)
- func (f *FileUsecase) Download(ctx context.Context, in *api.DownloadRequest, authorId string) ([]byte, error)
- func (f *FileUsecase) DownloadForRange(ctx context.Context, in *api.DownloadRequest, start int64, end int64, ...) ([]byte, int64, error)
- func (f *FileUsecase) InitiateUploadFile(ctx context.Context, in *api.InitiateMultipartUploadRequest) (*api.InitiateMultipartUploadResponse, error)
- func (f *FileUsecase) Metadata(ctx context.Context, in *api.FileMetadataRequest, authorId string) (*api.FileMetadataResponse, error)
- func (f *FileUsecase) Upload(ctx context.Context, in *api.UploadFileRequest, authorId string) (*api.UploadFileResponse, error)
- func (f *FileUsecase) UploadMultipartFileFile(ctx context.Context, in *api.UploadMultipartFileRequest) (*api.UploadMultipartFileResponse, error)
- func (f *FileUsecase) Version(ctx context.Context, key, authorId string) (string, error)
- type FileVersionReader
- type ReaderAtCloser
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 ¶
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 (f *FileUsecase) AbortMultipartUpload(ctx context.Context, in *api.AbortMultipartUploadRequest) (*api.AbortMultipartUploadResponse, error)
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 (*FileUsecase) InitiateUploadFile ¶
func (f *FileUsecase) InitiateUploadFile(ctx context.Context, in *api.InitiateMultipartUploadRequest) (*api.InitiateMultipartUploadResponse, error)
func (*FileUsecase) Metadata ¶
func (f *FileUsecase) Metadata(ctx context.Context, in *api.FileMetadataRequest, authorId string) (*api.FileMetadataResponse, error)
func (*FileUsecase) Upload ¶
func (f *FileUsecase) Upload(ctx context.Context, in *api.UploadFileRequest, authorId string) (*api.UploadFileResponse, error)
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 (f *FileUsecase) UploadMultipartFileFile(ctx context.Context, in *api.UploadMultipartFileRequest) (*api.UploadMultipartFileResponse, 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
}
Click to show internal directories.
Click to hide internal directories.