service

package
v0.0.0-...-ee63aef Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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 New

func New(boxSvc boxService.BoxService) (*FileService, error)

New creates a new Service

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

func (*FileService) WriteFile

func (s *FileService) WriteFile(ctx context.Context, boxID string, path string, content string) (*model.FileShareResult, error)

WriteFile writes content to a file at the specified path

Jump to

Keyboard shortcuts

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