filehandler

package
v0.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BytesStore

type BytesStore struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

func NewBytesStore

func NewBytesStore() (bs *BytesStore)

func (*BytesStore) CopyFrom

func (bs *BytesStore) CopyFrom(fo io.Reader) (n int64, err error)

func (*BytesStore) CopyTo

func (bs *BytesStore) CopyTo(fo io.Writer) (n int64, err error)

func (*BytesStore) Hash

func (bs *BytesStore) Hash() (hash string, err error)

type FileBasic

type FileBasic struct {
	Name string             `json:"name"`
	Path string             `json:"path"`
	Err  ftp_context.LogErr `json:"error"`
	Type FileType           `json:"type"`
	Size int64              `json:"size"`
	// contains filtered or unexported fields
}

func NewFileBasic

func NewFileBasic(path string) (fo *FileBasic)

func ReadDir

func ReadDir(ctx ftp_context.Context, dir_path string, exclude []string) (files []FileBasic, err error)

func (*FileBasic) Close

func (fo *FileBasic) Close() error

func (*FileBasic) Create

func (fo *FileBasic) Create() *FileBasic

func (*FileBasic) Ext

func (fo *FileBasic) Ext() string

func (*FileBasic) IsOpen

func (fo *FileBasic) IsOpen() bool

func (*FileBasic) ModTime

func (fo *FileBasic) ModTime() string

func (*FileBasic) Open

func (fo *FileBasic) Open() *FileBasic

func (*FileBasic) Read

func (fo *FileBasic) Read(buf []byte) (n int, err error)

func (*FileBasic) ReadAll

func (fo *FileBasic) ReadAll() (data []byte, err error)

func (*FileBasic) ResetError

func (fo *FileBasic) ResetError()

func (*FileBasic) Write

func (fo *FileBasic) Write(buf []byte) (n int, err error)

func (*FileBasic) WriteJson

func (fo *FileBasic) WriteJson(v any) ftp_context.LogErr

type FileHash

type FileHash struct {
	FileBasic
	Hash        string    `json:"hash"`
	LastModTime time.Time `json:"last_mod_time"`
	PrevModTime time.Time `json:"prev_mod_time"`
}

type FileTreeStruct

type FileTreeStruct struct {
	FileBasic
	Directory string      `json:"directory"`
	FilesList []*FileHash `json:"files_list"`

	LatesttUploadTime time.Time                    `json:"latest_upload_time"`
	LatestHash        time.Time                    `json:"latest_hash"`
	HashQueue         base.MutexedQueue[*FileHash] `json:"hash_queue"`
	UploadQueue       base.MutexedQueue[*FileHash] `json:"upload_queue"`
}

func (*FileTreeStruct) DequeueHashing

func (fts *FileTreeStruct) DequeueHashing() <-chan int64

func (*FileTreeStruct) DequeueUpload

func (fts *FileTreeStruct) DequeueUpload() <-chan int64

func (*FileTreeStruct) EnqueueHashing

func (fts *FileTreeStruct) EnqueueHashing(fh *FileHash)

func (*FileTreeStruct) EnqueueUpload

func (fts *FileTreeStruct) EnqueueUpload(fh *FileHash)

func (*FileTreeStruct) MarkDoneHashing

func (fts *FileTreeStruct) MarkDoneHashing(n int64)

func (*FileTreeStruct) MarkDoneUpload

func (fts *FileTreeStruct) MarkDoneUpload(n int64)

type FileType

type FileType = string

Jump to

Keyboard shortcuts

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