dir_handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileTree = NewFileTreeJson()
View Source
var Logger = logging.Logger

Functions

func FlatMap

func FlatMap[T any](lists ...[]T) (res []T)

func GetExcludeList

func GetExcludeList(excluded ...[]string) (tmp []string)

func InitialiseFileTree added in v1.1.2

func InitialiseFileTree(file_tree_path string)

func NilError

func NilError(err error) bool

func ReadDir

func ReadDir(ctx ftp_context.Context, dir_data initialiseclient.DirConfig) (err error)

func UpdateFileTree added in v1.1.4

func UpdateFileTree(ctx ftp_context.Context, lock_file_p string, file_tree_path string)

func WriteFileTree

func WriteFileTree(ctx ftp_context.Context, lock_file_p string, file_tree_path string) (err error)

Types

type FileState

type FileState string
const (
	FileStateHashed     FileState = "hashed"
	FileStateToHash     FileState = "to-hash"
	FileStateUploaded   FileState = "uploaded"
	FileStateToUpload   FileState = "to-upload"
	FileStateDownloaded FileState = "downloaded"
	FileStateToDownload FileState = "to-download"
	FileStateDeleted    FileState = "deleted"
	FileStateToDelete   FileState = "to-delete"
	FileStateToPull     FileState = "to-pull"
	FileStateToPush     FileState = "to-push"
)

type FileTreeJson

type FileTreeJson struct {
	Extensions map[string]bool
	// uses file_path as key on client | uses file_hash as key on server
	FileMap ftp_base.MutexedMap[*filehandler.FileHash] `json:"files"`

	// uses file_path as key on client | uses file_hash as key on server
	FileState ftp_base.MutexedMap[FileState] `json:"file_state"`
	// contains filtered or unexported fields
}

func NewFileTreeJson

func NewFileTreeJson() *FileTreeJson

func (*FileTreeJson) AddExtension added in v1.1.7

func (ft *FileTreeJson) AddExtension(e string)

func (*FileTreeJson) Lock

func (ft *FileTreeJson) Lock()

func (*FileTreeJson) RLock

func (ft *FileTreeJson) RLock()

func (*FileTreeJson) RUnlock

func (ft *FileTreeJson) RUnlock()

func (*FileTreeJson) Unlock

func (ft *FileTreeJson) Unlock()

type ReadDirResult

type ReadDirResult struct {
	FilesList []*filehandler.FileBasic
	ToRehash  []string
	ToUpload  []string
}

type TempFileData added in v1.2.0

type TempFileData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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