Documentation ¶
Index ¶
- Constants
- Variables
- func NewDaemon(ctx context.Context, koanf *koanf.Koanf) (daemon.Daemon, error)
- func RarLoader(ctx context.Context, archivePath string, f vfs.File, size int64) (map[string]fileEntry, error)
- func SevenZipLoader(ctx context.Context, archivePath string, ctxreader vfs.File, size int64) (map[string]fileEntry, error)
- func ZipLoader(ctx context.Context, archivePath string, f vfs.File, size int64) (map[string]fileEntry, error)
- type ArchiveFS
- func (a *ArchiveFS) FsName() string
- func (a *ArchiveFS) Info() (fs.FileInfo, error)
- func (a *ArchiveFS) IsDir() bool
- func (a *ArchiveFS) ModTime() time.Time
- func (a *ArchiveFS) Mode() fs.FileMode
- func (a *ArchiveFS) Name() string
- func (a *ArchiveFS) Open(ctx context.Context, filename string) (vfs.File, error)
- func (a *ArchiveFS) ReadDir(ctx context.Context, path string) ([]fs.DirEntry, error)
- func (a *ArchiveFS) Rename(ctx context.Context, oldpath string, newpath string) error
- func (a *ArchiveFS) Size() int64
- func (afs *ArchiveFS) Stat(ctx context.Context, filename string) (fs.FileInfo, error)
- func (a *ArchiveFS) Sys() any
- func (a *ArchiveFS) Type() fs.FileMode
- func (a *ArchiveFS) Unlink(ctx context.Context, filename string) error
- type Daemon
Constants ¶
View Source
const DaemonName string = "archive"
Variables ¶
View Source
var ArchiveFactories = map[string]vfs.FsFactory{ ".zip": func(ctx context.Context, sourcePath string, f vfs.File) (vfs.Filesystem, error) { stat, err := f.Info() if err != nil { return nil, err } return NewArchive(ctx, sourcePath, stat.Name(), f, stat.Size(), ZipLoader) }, ".rar": func(ctx context.Context, sourcePath string, f vfs.File) (vfs.Filesystem, error) { stat, err := f.Info() if err != nil { return nil, err } return NewArchive(ctx, sourcePath, stat.Name(), f, stat.Size(), RarLoader) }, ".7z": func(ctx context.Context, sourcePath string, f vfs.File) (vfs.Filesystem, error) { stat, err := f.Info() if err != nil { return nil, err } return NewArchive(ctx, sourcePath, stat.Name(), f, stat.Size(), SevenZipLoader) }, }
Functions ¶
func SevenZipLoader ¶
Types ¶
type ArchiveFS ¶
type ArchiveFS struct {
// contains filtered or unexported fields
}
func NewArchive ¶
type Daemon ¶
type Daemon struct{}
func (*Daemon) Extensions ¶
Extensions implements daemon.Daemon.
Click to show internal directories.
Click to hide internal directories.