local_file

package
v0.0.0-...-094e1e4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusIdle         = 0
	StatusFinished     = 1
	StatusCanceled     = 2
	StatusError        = 3
	StatusWaitCanceled = 5
	StatusRunning      = 6
)

Functions

func ApiEvent

func ApiEvent(c echo.Context) error

func NewDeviceIfNeeded

func NewDeviceIfNeeded(configPath string) string

func StartLocalFileSync

func StartLocalFileSync(driverId uint64, serverAddr string, h int64, m int64, srcPath, ignores, encoder string)

Types

type Client

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

func (*Client) Chan

func (c *Client) Chan() chan TaskInfo

func (*Client) Message

func (c *Client) Message() TaskInfo

type CronTask

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

type DriverLocalFile

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

func GetOrLoadDriver

func GetOrLoadDriver(driverId uint64) (*DriverLocalFile, error)

func (*DriverLocalFile) StartOrStop

func (d *DriverLocalFile) StartOrStop(ctx context.Context, start bool, serverAddr, srcPath, ignores, encoder string)

type TaskInfo

type TaskInfo struct {
	TaskInfoClearable

	Status       int   `json:"status"`
	LastDoneTime int64 `json:"lastDoneTime"`

	Cost int64 `json:"cost"`

	ErrMsg   string   `json:"errMsg"`
	Warnings []string `json:"warnings"`

	CurFile       string   `json:"curFile"`
	CurSize       uint64   `json:"curSize"`
	CurDirItemCnt uint64   `json:"curDirItemCnt"`
	CurDir        string   `json:"curDir"`
	Ignores       []string `json:"ignores"`
	// contains filtered or unexported fields
}

type TaskInfoClearable

type TaskInfoClearable struct {
	Size      uint64 `json:"size"`
	FileCount uint64 `json:"fileCount"`
	DirCount  uint64 `json:"dirCount"`

	TotalSize      uint64 `json:"totalSize"`
	TotalFileCount uint64 `json:"totalFileCount"`
	TotalDirCount  uint64 `json:"totalDirCount"`
}

type WebUploadDirProcess

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

func (*WebUploadDirProcess) EndDir

func (h *WebUploadDirProcess) EndDir(filePath string, info os.FileInfo)

func (*WebUploadDirProcess) EndFile

func (h *WebUploadDirProcess) EndFile(filePath string, info os.FileInfo)

func (*WebUploadDirProcess) EndUploadFile

func (h *WebUploadDirProcess) EndUploadFile(filePath string, info os.FileInfo)

func (*WebUploadDirProcess) FilePathFilter

func (h *WebUploadDirProcess) FilePathFilter(filePath string) bool

func (*WebUploadDirProcess) OnFileError

func (h *WebUploadDirProcess) OnFileError(filePath string, err error)

func (*WebUploadDirProcess) PushFile

func (h *WebUploadDirProcess) PushFile(info os.FileInfo)

func (*WebUploadDirProcess) SkipFile

func (h *WebUploadDirProcess) SkipFile(filePath string, info os.FileInfo, hash string)

func (*WebUploadDirProcess) StartDir

func (h *WebUploadDirProcess) StartDir(filePath string, info os.FileInfo, n uint64)

func (*WebUploadDirProcess) StartFile

func (h *WebUploadDirProcess) StartFile(filePath string, info os.FileInfo)

func (*WebUploadDirProcess) StartUploadFile

func (h *WebUploadDirProcess) StartUploadFile(filePath string, info os.FileInfo, hash string)

type WebUploadProcess

type WebUploadProcess struct {
	StartTime time.Time
	// contains filtered or unexported fields
}

func (*WebUploadProcess) Close

func (w *WebUploadProcess) Close(resp core.FileResp, err error)

func (*WebUploadProcess) EndFile

func (w *WebUploadProcess) EndFile(index int, filePath string, info os.FileInfo, exist bool)

func (*WebUploadProcess) HasPushedAllToStack

func (w *WebUploadProcess) HasPushedAllToStack()

func (*WebUploadProcess) New

func (w *WebUploadProcess) New(srcPath string, concurrent int, conns []net.Conn) core.UploadProcess

func (*WebUploadProcess) OnFileError

func (w *WebUploadProcess) OnFileError(index int, filePath string, info os.FileInfo, err error)

func (*WebUploadProcess) PushFile

func (w *WebUploadProcess) PushFile(info os.FileInfo)

func (*WebUploadProcess) Show

func (w *WebUploadProcess) Show(p *core.Process)

func (*WebUploadProcess) StackSizeHandler

func (w *WebUploadProcess) StackSizeHandler(size int)

func (*WebUploadProcess) StartFile

func (w *WebUploadProcess) StartFile(index int, filePath string, info os.FileInfo)

func (*WebUploadProcess) Verbose

func (w *WebUploadProcess) Verbose() bool

Jump to

Keyboard shortcuts

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