file

package
v0.0.0-...-7899014 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Copy = pp.Copy
	Seq  = pp.Seq

	PathSeparator = fsys.PathSeparator

	Select     = index.Select
	MatchEntry = index.MatchEntry
	Count      = index.Count
	Tap        = index.Tap
	Desc       = index.Desc
	Asc        = index.Asc

	IdxType    = entity.IdxType
	NSSummary  = entity.NSSummary
	NSEntity   = entity.NSEntity
	IdxReferTo = entity.IdxReferTo
)

Functions

func TestBuild

func TestBuild(
	t *testing.T,
	scope Scope,
	shuffleDir fsys.ShuffleDir,
	wg *pr2.WaitGroup,
)

func TestBuildMerge

func TestBuildMerge(
	t *testing.T,
	scope Scope,
)

func TestFileFS

func TestFileFS(
	t *testing.T,
	build Build,
	iterDisk IterDiskFile,
	newFileFS filebase.NewFileFS,
	shuffleDir fsys.ShuffleDir,
	wg *pr2.WaitGroup,
)

func TestIterDiskCancelWaitGroup

func TestIterDiskCancelWaitGroup(
	t *testing.T,
	wg *pr2.WaitGroup,
	iterDisk IterDiskFile,
)

func TestIterIgnore

func TestIterIgnore(
	t *testing.T,
	scope Scope,
)

func TestPack

func TestPack(
	t *testing.T,
	scope Scope,
)

func TestPushFile

func TestPushFile(
	t *testing.T,
	build Build,
	iterDisk IterDiskFile,
	newMem storemem.New,
	push entity.Push,
	save entity.SaveEntity,
	newKV storekv.New,
	indexManager index.IndexManager,
	scope Scope,
	iterFile IterFile,
	shuffleDir fsys.ShuffleDir,
	wg *pr2.WaitGroup,
)

func TestSave

func TestSave(
	t *testing.T,
	walk Walk,
	scope Scope,
)
func TestSymlink(
	t *testing.T,
	build Build,
	iterDiskfile IterDiskFile,
	wg *pr2.WaitGroup,
)

func TestUpdate

func TestUpdate(
	t *testing.T,
	newKV storekv.New,
	newMem storemem.New,
	scope Scope,
	shuffle fsys.ShuffleDir,
	wg *pr2.WaitGroup,
)

func TestZip

func TestZip(
	t *testing.T,
	scope Scope,
)

func TestZipFile

func TestZipFile(
	t *testing.T,
	zip Zip,
	iterDisk IterDiskFile,
	unzip Unzip,
	equal Equal,
	build Build,
	iterFile IterFile,
	shuffleDir fsys.ShuffleDir,
	wg *pr2.WaitGroup,
)

Types

type Build

type Build func(
	ctx context.Context,
	root *File,
	cont Sink,
	options ...BuildOption,
) Sink

type BuildOption

type BuildOption interface {
	IsBuildOption()
}

type ChunkThreshold

type ChunkThreshold = filebase.ChunkThreshold

type Content

type Content = filebase.Content

type Def

type Def struct{}

func (Def) Build

func (Def) Build(
	toContents ToContents,
	smallFileThreshold SmallFileThreshold,
	fetchEntity entity.Fetch,
	saveEntity entity.SaveEntity,
	packThreshold PackThreshold,
	parallel sys.Parallel,
	scope Scope,
	save entity.SaveEntity,
) Build

func (Def) Configs

func (_ Def) Configs(
	testing sys.Testing,
) (
	packThreshold PackThreshold,
	smallFileThreshold SmallFileThreshold,
)

func (Def) DefaultIgnore

func (_ Def) DefaultIgnore() Ignore

func (Def) Equal

func (Def) Equal(
	scope Scope,
	newHashState key.NewHashState,
) (equal Equal)

func (Def) IterDiskFile

func (Def) IterDiskFile(
	ignore Ignore,
	isRestrictedPath fsys.IsRestrictedPath,
) (iter IterDiskFile)

func (Def) IterFile

func (Def) IterFile(
	fetch entity.Fetch,
	ignore Ignore,
) (
	IterFile,
	IterKey,
)

func (Def) IterVirtual

func (_ Def) IterVirtual(
	ignore Ignore,
) IterVirtual

func (Def) Reverse

func (_ Def) Reverse() Reverse

func (Def) Unzip

func (_ Def) Unzip() Unzip

func (Def) Update

func (_ Def) Update(
	zip Zip,
	unzip Unzip,
	scope Scope,
) Update

func (Def) Walk

func (_ Def) Walk() (walk Walk)

func (Def) Zip

func (_ Def) Zip(
	scope Scope,
) Zip

type DiskFile

type DiskFile struct {
	Path string
	// contains filtered or unexported fields
}

func (DiskFile) GetDevice

func (d DiskFile) GetDevice(_ Scope) uint64

func (DiskFile) GetIsDir

func (d DiskFile) GetIsDir(_ Scope) bool

func (DiskFile) GetModTime

func (d DiskFile) GetModTime(_ Scope) time.Time

func (DiskFile) GetMode

func (d DiskFile) GetMode(_ Scope) os.FileMode

func (DiskFile) GetName

func (d DiskFile) GetName(_ Scope) string

func (DiskFile) GetSize

func (d DiskFile) GetSize(_ Scope) int64

func (DiskFile) WithReader

func (d DiskFile) WithReader(scope Scope, fn func(io.Reader) error) (err error)

type Equal

type Equal func(
	a, b Src,
	fn func(any, any, string),
) (bool, error)

type File

type File = filebase.File

type FileInfo

type FileInfo struct {
	FileLike
	Path string // relative path of file
}

type FileInfoThunk

type FileInfoThunk struct {
	FileInfo FileInfo
	Expand   func(bool)
	Path     string // relative path of file
}

type FileLike

type FileLike interface {
	// basic infos
	GetIsDir(Scope) bool
	GetName(Scope) string
	GetSize(Scope) int64
	GetMode(Scope) os.FileMode
	GetModTime(Scope) time.Time
	GetDevice(Scope) uint64

	// content
	WithReader(
		Scope,
		func(io.Reader) error,
	) error
}

type Ignore

type Ignore func(
	path string,
	fileLike FileLike,
) bool

type IterDiskFile

type IterDiskFile func(
	ctx context.Context,
	path string,
	cont Src,
	options ...IterDiskFileOption,
) Src

type IterDiskFileOption

type IterDiskFileOption interface {
	IsIterDiskFileOption()
}

type IterFile

type IterFile func(ctx context.Context, file *File, cont Src) Src

type IterKey

type IterKey func(ctx context.Context, key Key, cont Src) Src

type IterVirtual

type IterVirtual func(file Virtual, cont Src, options ...IterVirtualOption) Src

type IterVirtualOption

type IterVirtualOption interface {
	IsIterVirtualOption()
}

type Key

type Key = key.Key

type Limit

type Limit = index.Limit

type MaxChunkSize

type MaxChunkSize = filebase.MaxChunkSize

type NewContentReader

type NewContentReader = filebase.NewContentReader

type NoSubsSort

type NoSubsSort bool

func (NoSubsSort) IsIterVirtualOption

func (_ NoSubsSort) IsIterVirtualOption()

type Pack

type Pack = filebase.Pack

type PackThreshold

type PackThreshold int

type PackThunk

type PackThunk struct {
	Expand func(bool)
	Path   string
	Pack   // relative path of dir
}

type Partition

type Partition struct {
	Begin  int
	End    int
	Height int
	Weight int
}

type PredictExpandFileInfoThunk

type PredictExpandFileInfoThunk func(_, _ FileInfoThunk) (bool, error)

func (PredictExpandFileInfoThunk) IsZipOption

func (_ PredictExpandFileInfoThunk) IsZipOption()

type Reverse

type Reverse func(Src, Src) Src

type Scope

type Scope = dscope.Scope

type SingleDevice

type SingleDevice bool

func (SingleDevice) IsIterDiskFileOption

func (_ SingleDevice) IsIterDiskFileOption()

type Sink

type Sink = pp.Sink

func TapZipItem

func TapZipItem(fn func(ZipItem)) Sink

type SmallFileThreshold

type SmallFileThreshold int64

type Src

type Src = pp.Src

func ExpandAll

func ExpandAll(src Src) Src

func ExpandFileInfoThunk

func ExpandFileInfoThunk(src Src) Src

type Store

type Store = store.Store

type Sub

type Sub = filebase.Sub

type Subs

type Subs = filebase.Subs

type TapAddFileInfo

type TapAddFileInfo func(FileInfo)

func (TapAddFileInfo) IsUpdateOption

func (_ TapAddFileInfo) IsUpdateOption()

type TapBuildFile

type TapBuildFile func(FileInfo, *File)

func (TapBuildFile) IsBuildOption

func (_ TapBuildFile) IsBuildOption()

type TapDeleteFileInfo

type TapDeleteFileInfo func(FileInfo)

func (TapDeleteFileInfo) IsUpdateOption

func (_ TapDeleteFileInfo) IsUpdateOption()

type TapModifyFileInfo

type TapModifyFileInfo func(FileInfo, FileInfo)

func (TapModifyFileInfo) IsUpdateOption

func (_ TapModifyFileInfo) IsUpdateOption()

type TapReadFile

type TapReadFile func(FileInfo)

func (TapReadFile) IsBuildOption

func (_ TapReadFile) IsBuildOption()

type ToContents

type ToContents = filebase.ToContents

type Unzip

type Unzip func(
	src Src,
	fn func(ZipItem) any,
	cont Src,
) Src

type Update

type Update func(
	path string,
	from Src,
	fromTime time.Time,
	src Src,
	watcher *fsys.Watcher,
	options ...UpdateOption,
) Src

type UpdateOption

type UpdateOption interface {
	IsUpdateOption()
}

type UseGitIgnore

type UseGitIgnore bool

func (UseGitIgnore) IsIterDiskFileOption

func (_ UseGitIgnore) IsIterDiskFileOption()

type Virtual

type Virtual struct {
	ModTime time.Time
	Name    string
	Subs    []Virtual
	Content []byte
	Size    int64
	Mode    os.FileMode
	IsDir   bool
}

func (Virtual) GetDevice

func (v Virtual) GetDevice(_ Scope) uint64

func (Virtual) GetIsDir

func (v Virtual) GetIsDir(_ Scope) bool

func (Virtual) GetModTime

func (v Virtual) GetModTime(_ Scope) time.Time

func (Virtual) GetMode

func (v Virtual) GetMode(_ Scope) os.FileMode

func (Virtual) GetName

func (v Virtual) GetName(_ Scope) string

func (Virtual) GetSize

func (v Virtual) GetSize(_ Scope) int64

func (Virtual) WithReader

func (v Virtual) WithReader(scope Scope, fn func(io.Reader) error) error

type Walk

type Walk func(
	fn WalkFunc,
) Sink

type WalkFunc

type WalkFunc = func(string, FileLike) error

type WriteContents

type WriteContents = filebase.WriteContents

type Zip

type Zip func(
	a Src,
	b Src,
	cont Src,
	options ...ZipOption,
) Src

type ZipItem

type ZipItem struct {
	A   any
	B   any
	Dir string
}

type ZipOption

type ZipOption interface {
	IsZipOption()
}

Jump to

Keyboard shortcuts

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