walk

package
v1.0.14-0...-56f5250 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	M_ZIP = Magic{0x50, 0x4B, 0x03, 0x04}
	M_RAR = Magic{0x52, 0x61, 0x72, 0x21, 0x1A, 0x07}
	M_GZ  = Magic{0x1F, 0x8B}
	M_BZ2 = Magic{0x42, 0x5A, 0x68}
	M_LZ4 = Magic{0x04, 0x22, 0x4D, 0x18}
	M_XZ  = Magic{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}
	M_AR  = Magic{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A}
	M_7Z  = Magic{0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C}
)

Functions

func Walk

func Walk(ctx context.Context, name, origin string, filter ExtractFileFilter, do WalkFileFunc) (size int64, err error)

Walk 遍历文件/目录/压缩包 name: 检测文件名 origin: 检测数据源 filter: 过滤需要提取的文件 do: 对文件的操作 size: 检测文件大小

Types

type ExtractFileFilter

type ExtractFileFilter func(relpath string) bool

type Magic

type Magic []byte

type WalkFileFunc

type WalkFileFunc func(parent *model.File, files []*model.File)

Jump to

Keyboard shortcuts

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