Documentation
¶
Index ¶
- type FileContent
- type FileService
- func (s *FileService) GetFile(ctx context.Context, pathWithBoxID string) (*FileContent, error)
- func (s *FileService) HeadFile(ctx context.Context, pathWithBoxID string) (*model.FileStat, error)
- func (s *FileService) ReclaimFiles(ctx context.Context) (*model.FileShareResult, error)
- func (s *FileService) ShareFile(ctx context.Context, boxID, pathWithBoxID string) (*fileModel.FileShareResult, error)
- func (s *FileService) WriteFile(ctx context.Context, boxID string, path string, content string) (*model.FileShareResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContent ¶
type FileContent struct { Reader io.ReadCloser MimeType string Size int64 }
FileContent represents the content of a file
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
FileService handles file operations for the share directory
func (*FileService) GetFile ¶
func (s *FileService) GetFile(ctx context.Context, pathWithBoxID string) (*FileContent, error)
GetFile gets the content of a file
func (*FileService) HeadFile ¶
func (s *FileService) HeadFile(ctx context.Context, pathWithBoxID string) (*model.FileStat, error)
HeadFile gets metadata about a file
func (*FileService) ReclaimFiles ¶
func (s *FileService) ReclaimFiles(ctx context.Context) (*model.FileShareResult, error)
ReclaimFiles removes files that haven't been accessed for more than 14 days
func (*FileService) ShareFile ¶
func (s *FileService) ShareFile(ctx context.Context, boxID, pathWithBoxID string) (*fileModel.FileShareResult, error)
ShareFile shares a file from a box to the share directory
Click to show internal directories.
Click to hide internal directories.