tool

package
v0.0.0-...-6e53ccd Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Tools               = make(map[string]Tool)
	MultipartExtensions = make(map[string]MultipartExtension)
)

Functions

func DecompressFromFolderTraversal

func DecompressFromFolderTraversal(r ArchiveReader, outputPath string, args model.ArchiveInnerArgs, up model.UpdateProgress) error

func GenerateMetaTreeFromFolderTraversal

func GenerateMetaTreeFromFolderTraversal(r ArchiveReader) (bool, []model.ObjTree)

func GetArchiveTool

func GetArchiveTool(ext string) (*MultipartExtension, Tool, error)

func MakeModelObj

func MakeModelObj(file os.FileInfo) *model.Object

func RegisterTool

func RegisterTool(tool Tool)

Types

type ArchiveReader

type ArchiveReader interface {
	Files() []SubFile
}

type CanEncryptSubFile

type CanEncryptSubFile interface {
	IsEncrypted() bool
	SetPassword(password string)
}

type MultipartExtension

type MultipartExtension struct {
	PartFileFormat  string
	SecondPartIndex int
}

type SubFile

type SubFile interface {
	Name() string
	FileInfo() fs.FileInfo
	Open() (io.ReadCloser, error)
}

type Tool

type Tool interface {
	AcceptedExtensions() []string
	AcceptedMultipartExtensions() map[string]MultipartExtension
	GetMeta(ss []*stream.SeekableStream, args model.ArchiveArgs) (model.ArchiveMeta, error)
	List(ss []*stream.SeekableStream, args model.ArchiveInnerArgs) ([]model.Obj, error)
	Extract(ss []*stream.SeekableStream, args model.ArchiveInnerArgs) (io.ReadCloser, int64, error)
	Decompress(ss []*stream.SeekableStream, outputPath string, args model.ArchiveInnerArgs, up model.UpdateProgress) error
}

type WrapFileInfo

type WrapFileInfo struct {
	model.Obj
}

Jump to

Keyboard shortcuts

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