Versions in this module Expand all Collapse all v0 v0.1.3 Sep 3, 2022 Changes in this version + type CreateFS interface + Create func(path string) (io.WriteCloser, error) type FSClient + func (c *FSClient) Mkdir(name string, mode fs.FileMode) error + func (c *FSClient) Rename(name string, newName string) error type FSServer + func (s *FSServer) FSCaps() *FSCapability type FileOperationRequest + Path2 string type FileOperationResult + Buf []byte + type MkdirFS interface + Mkdir func(name string, mode fs.FileMode) error + type OpenWriterFS interface + OpenWriter func(name string, flag int) (io.WriteCloser, error) + type RemoveFS interface + Remove func(name string) error + type RenameFS interface + Rename func(name string, newName string) error + type TruncateFS interface + Truncate func(name string, size int64) error + type WrappedFS struct + func (w *WrappedFS) Capability() *FSCapability + func (w *WrappedFS) Create(name string) (io.WriteCloser, error) + func (w *WrappedFS) Mkdir(path string, mode fs.FileMode) error + func (w *WrappedFS) OpenWriter(name string, flag int) (io.WriteCloser, error) + func (w *WrappedFS) ReadDir(name string) ([]fs.DirEntry, error) + func (w *WrappedFS) ReadOnly() *WrappedFS + func (w *WrappedFS) Remove(name string) error + func (w *WrappedFS) Rename(name, newName string) error + func (w *WrappedFS) Stat(name string) (fs.FileInfo, error) + func (w *WrappedFS) Truncate(name string, size int64) error v0.1.2 Aug 31, 2022 v0.1.1 Aug 27, 2022 v0.1.0 Aug 25, 2022 Changes in this version + const BinaryMessageResponseType + const ThumbnailSuffix + const ThumbnailWidth + var DefaultThumbnailer = ThumbnailerGroup + var ErrNotSupported = errors.New("Not supported format") + func ContentTypeByPath(s string) string + func NewPromise() *promise[T] + type CachedThumbnailer struct + CacheDir string + GenerateFunc func(ctx context.Context, f fs.FS, src, dst string) error + SupportedFunc func(typ string) bool + func NewImageThumbnailer(cacheDir string) *CachedThumbnailer + func NewVideoThumbnailer(cacheDir, ffmpegPath string) *CachedThumbnailer + func (t *CachedThumbnailer) GetThumbnail(ctx context.Context, f fs.FS, src, typ string, opt any) (*Thumbnail, error) + func (t *CachedThumbnailer) Supported(typ string) bool + type FS interface + Capability func() *FSCapability + Create func(path string) (io.WriteCloser, error) + OpenWriter func(path string, flag int) (io.WriteCloser, error) + Remove func(path string) error + func NewWritableDirFS(dir string) FS + func WrapFS(fsys fs.FS) FS + type FSCapability struct + Create bool + Read bool + Remove bool + Write bool + func Capability(fsys fs.FS) FSCapability + type FSClient struct + MaxReadSize int + Timeout time.Duration + func NewFSClient(sendFunc func(req *FileOperationRequest) error) *FSClient + func (c *FSClient) Abort() error + func (c *FSClient) Create(name string) (io.WriteCloser, error) + func (c *FSClient) HandleMessage(data []byte, isjson bool) error + func (c *FSClient) Open(name string) (fs.File, error) + func (c *FSClient) OpenDir(name string) (fs.ReadDirFile, error) + func (c *FSClient) OpenWriter(name string, flag int) (io.WriteCloser, error) + func (c *FSClient) ReadDir(name string) ([]fs.DirEntry, error) + func (c *FSClient) ReadDirRange(name string, pos, limit int) ([]fs.DirEntry, error) + func (c *FSClient) Remove(name string) error + func (c *FSClient) Stat(name string) (fs.FileInfo, error) + func (c *FSClient) Truncate(name string, size int64) error + type FSServer struct + func NewFSServer(fsys fs.FS, parallels int) *FSServer + func (h *FSServer) HandleMessage(ctx context.Context, data []byte, isjson bool, ...) error + func (h *FSServer) HanldeFileOp(op *FileOperationRequest) (any, error) + type FileEntry struct + CreatedTime int64 + FileName string + FileSize int64 + Metadata map[string]any + Type string + UpdatedTime int64 + Writable bool + func NewFileEntry(info os.FileInfo, fswritable bool) *FileEntry + func (f *FileEntry) IsDir() bool + func (f *FileEntry) ModTime() time.Time + func (f *FileEntry) Mode() fs.FileMode + func (f *FileEntry) Name() string + func (f *FileEntry) SetMetaData(key string, value any) + func (f *FileEntry) Size() int64 + func (f *FileEntry) Sys() any + type FileOperationRequest struct + Buf []byte + Len int + Op string + Path string + Pos int64 + RID any + func (r *FileOperationRequest) ToBytes() []byte + type FileOperationResult struct + Data json.RawMessage + Error string + RID any + func (r *FileOperationResult) IsJSON() bool + func (r *FileOperationResult) ToBytes() []byte + type OpenDirFS interface + OpenDir func(name string) (fs.ReadDirFile, error) + type RealPathResolver interface + RealPath func(string) string + type Thumbnail struct + Path string + Type string + type Thumbnailer interface + GetThumbnail func(ctx context.Context, f fs.FS, path, typ string, opt any) (*Thumbnail, error) + Supported func(typ string) bool + type ThumbnailerGroup struct + Thumbnailers []Thumbnailer + func (g *ThumbnailerGroup) Register(t Thumbnailer) + func (g ThumbnailerGroup) GetThumbnail(ctx context.Context, f fs.FS, path, typ string, opt any) (*Thumbnail, error) + func (g ThumbnailerGroup) Supported(typ string) bool