mount

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CmdError 錯誤
	CmdError = iota + 1
	// CmdHeart websocket 心跳防止瀏覽器 關閉不獲取 websocket
	CmdHeart
	// CmdProgress 更新進度
	CmdProgress
	// CmdDone 操作完成
	CmdDone
	// CmdInit 初始化
	CmdInit
	// CmdYes 確認操作
	CmdYes
	// CmdNo 取消操作
	CmdNo
	// CmdExist 檔案已經存在
	CmdExist
	// CmdYesAll 覆蓋全部 重複檔案
	CmdYesAll
	// CmdSkip 跳過 重複檔案
	CmdSkip
	// CmdSkipAll 跳過全部 重複檔案
	CmdSkipAll
)

Variables

Separator .

Functions

func Compress

func Compress(ws *websocket.Conn, dir string, timeout time.Duration) (name string, names []string, e error)

Compress 執行 壓縮

func Copy

func Copy(ws *websocket.Conn, dir, srcDir string, timeout time.Duration) (names []string, e error)

Copy 複製檔案

func Cut

func Cut(ws *websocket.Conn, dir, srcDir string, timeout time.Duration) (names []string, e error)

Cut 剪下檔案

func Init

func Init(ms []configure.Mount) (e error)

Init .

func Uncompress

func Uncompress(ws *websocket.Conn, dir string, timeout time.Duration) (name string, e error)

Uncompress 執行 解壓

Types

type FileInfo

type FileInfo struct {
	Name  string `json:"name,omitempty"`
	Mode  uint32 `json:"mode,omitempty"`
	Size  int64  `json:"size,omitempty"`
	IsDir bool   `json:"isDir,omitempty"`
}

FileInfo 檔案信息

type FileSystem

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

FileSystem .

func Single

func Single() *FileSystem

Single .

func (*FileSystem) List

func (f *FileSystem) List() []Mount

List .

func (*FileSystem) Push

func (f *FileSystem) Push(name, root string, read, write, shared bool)

Push .

func (*FileSystem) Root

func (f *FileSystem) Root(name string) *Mount

Root .

type Mount

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

Mount .

func (*Mount) Filename

func (m *Mount) Filename(path string) (filename string, e error)

Filename .

func (*Mount) LS

func (m *Mount) LS(path string) (dir string, results []FileInfo, e error)

LS .

func (*Mount) Name

func (m *Mount) Name() string

Name .

func (*Mount) Read

func (m *Mount) Read() bool

Read .

func (*Mount) Shared

func (m *Mount) Shared() bool

Shared .

func (*Mount) Write

func (m *Mount) Write() bool

Write .

Jump to

Keyboard shortcuts

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