walk

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMap

type FileMap map[string]os.FileInfo

FileMap is type for holding a map of files information indexed by their name (relative path).

func (FileMap) Diff

func (f FileMap) Diff(other FileMap) (diff []FileOperation)

Diff compares the two filetrees and returns a list of differences (files to be removed, updated or created).

The differences are relative to the calling FileMap, which means that for example UploadFile opearion should transfer the file FROM the calling FileMap location to the other FileMap location.

type FileOperation

type FileOperation struct {
	Path string
	Info os.FileInfo
	Type FileOperationType
}

type FileOperationType

type FileOperationType int64

FileOperationType is used to identify what kind of operation should be performed on a file.

const (
	// UploadFile means that file should be uploaded (created).
	UploadFile FileOperationType = iota
	// UpdateFile means that file should be uploaded (modified).
	UpdateFile
	// RemoveFile means that file should be removed.
	RemoveFile
)

type FileWalk

type FileWalk chan string

func (FileWalk) Walk

func (f FileWalk) Walk(path string, info os.FileInfo, err error) error

Jump to

Keyboard shortcuts

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