Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
Data []byte `json:"data"`
Ext string `json:"ext"`
ID string `json:"id"`
MimeType string `json:"type"`
Name string `json:"name"`
Size int64 `json:"size"`
ConvertedFile string
IsConverted bool
Image image.Image
Runtime *wails.Runtime
}
File represents an image file.
func (*File) GetConvertedSize ¶
GetConvertedSize returns the size of the converted file.
func (*File) GetSavings ¶
GetSavings returns the delta between original and converted file size.
type FileManager ¶
type FileManager struct {
Files []*File
Runtime *wails.Runtime
Logger *wails.CustomLogger
// contains filtered or unexported fields
}
FileManager handles collections of Files for conversion.
func NewFileManager ¶
func NewFileManager(c *config.Config, s *stat.Stat) *FileManager
NewFileManager creates a new FileManager.
func (*FileManager) Clear ¶
func (fm *FileManager) Clear()
Clear removes the files in the FileManager.
func (*FileManager) Convert ¶
func (fm *FileManager) Convert() (errs []error)
Convert runs the conversion on all files in the FileManager.
func (*FileManager) Delete ¶
func (fm *FileManager) Delete()
func (*FileManager) HandleFile ¶
func (fm *FileManager) HandleFile(fileJson string) (err error)
HandleFile processes a file from the client.
func (*FileManager) OpenFile ¶
func (fm *FileManager) OpenFile(p string) error
OpenFile opens the file at the given filepath using the file's native file application.
Click to show internal directories.
Click to hide internal directories.