Versions in this module Expand all Collapse all v0 v0.0.1 Sep 23, 2025 Changes in this version + const CommandBackspace + const CommandCollectTrigger + const CommandCopyDirpath + const CommandCopyFile + const CommandCopyFilename + const CommandCopyFilepath + const CommandCursorMoveDown + const CommandCursorMoveEnd + const CommandCursorMoveHalfPageDown + const CommandCursorMoveHalfPageUp + const CommandCursorMoveHome + const CommandCursorMoveLeft + const CommandCursorMovePageDown + const CommandCursorMovePageUp + const CommandCursorMoveRight + const CommandCursorMoveUp + const CommandCutFile + const CommandDelete + const CommandDownloadFile + const CommandEnsure + const CommandEnter + const CommandFilter + const CommandGoto + const CommandGotoNext + const CommandGotoPrev + const CommandGotoRoot + const CommandHelp + const CommandInput + const CommandKeymap + const CommandPasteFile + const CommandQuit + const CommandReload + const CommandSelect + const CommandSync + const CommandSyncExec + const CommandSystem + const ModeCommand + const ModeConfirm + const ModeFilter + const ModeHelp + const ModeKeymap + const ModeNormal + const ModeSync + var BottomErrs = []error + var CacheSyncModelMap = make(map[string]*bdpan.SyncModel, 0) + var CommandKeymaps = []Keymap + var CommonKeymaps = []Keymap + var ConfirmKeymaps = []Keymap + var ErrActionFail = errors.New("操作失败") + var ErrFileExists = errors.New("文件已存在") + var ErrNoFileSelect = errors.New("请先选择文件") + var ErrNoTypeToPaste = errors.New("请先进行复制或剪切操作") + var ErrNotCopyFile = errors.New("请先使用 yy 复制文件") + var ErrQuit = errors.New("quit bdpan") + var HelpKeymaps = []Keymap + var KeymapBackspace1 = ...("退格") + var KeymapBackspace2 = ...("退格") + var KeymapCursorMoveDown1 = ...("光标向下移动一行") + var KeymapCursorMoveDown2 = ...("光标向下移动一行") + var KeymapCursorMoveUp1 = ...("光标向上移动一行") + var KeymapCursorMoveUp2 = ...("光标向上移动一行") + var KeymapEnter = ...("确定") + var KeymapHelp = ...("帮助") + var KeymapInput = ...("输入") + var KeymapKeymaps = []Keymap + var KeymapQuit1 = ...("退出") + var KeymapQuit2 = ...("退出") + var KeymapQuit3 = ...("退出") + var Log = bdpan.Log + var ModeKeymapsMap = map[Mode][]Keymap + var NormalKeymaps = []Keymap + var SyncKeymaps = []Keymap + func CanCacheError(e error) bool + func CancelCollect(file *bdpan.FileInfoDto) error + func ConverFilesToSelectItems(s *terminal.Select, files []*bdpan.FileInfoDto) []*terminal.SelectItem + func FillCacheToSelect(s *terminal.Select, dir, selectPath string) error + func FillFileToSelect(s *terminal.Select, dir, selectPath string) error + func FillSyncToSelect(s *terminal.Select, file *bdpan.FileInfoDto) error + func FillSystemToSelect(s *terminal.Select, action SystemAction) error + func FilterFileFiles(files []*bdpan.FileInfoDto) (filterFiles []*bdpan.FileInfoDto) + func GetAllCacheFiles() []*bdpan.FileInfoDto + func GetAllLocalFiles() (files []*bdpan.FileInfoDto, err error) + func GetCacheSelectIndex(a SystemAction) (i int, f bool) + func GetCollectFiles() []*bdpan.FileInfoDto + func GetRootFile() *bdpan.FileInfoDto + func GetSyncModelsByFilePath(path string) []*bdpan.SyncModel + func IsCollect(file *bdpan.FileInfoDto) bool + func IsInErrors(e error, errs []error) bool + func IsKeymapK(k Keymap, key *tcell.EventKey) bool + func IsSync(file *bdpan.FileInfoDto) bool + func NewHelpItems(m Mode) []terminal.HelpItem + func NewSystemSelectItem(icon, name string, action SystemAction) *terminal.SelectItem + func RefreshSyncModelCache() + func SaveCollect(file *bdpan.FileInfoDto) error + func SetCacheSelectIndex(a SystemAction, i int) + type BaseMode struct + CurrEventKey *tcell.EventKey + KeymapFn KeymapFn + Keymaps []Keymap + Mode Mode + PrevCommand Command + PrevEventKey *tcell.EventKey + SelectItems []*terminal.SelectItem + T *terminal.Terminal + func (b *BaseMode) AppendSelectItems(item *terminal.SelectItem) + func (b *BaseMode) ClearPrevCommand() + func (b *BaseMode) ClearSelectItems() + func (b *BaseMode) Draw() error + func (b *BaseMode) GetKeymap() Keymap + func (b *BaseMode) GetKeymapFn() KeymapFn + func (b *BaseMode) GetKeymaps() []Keymap + func (b *BaseMode) GetPrevCommand() Command + func (b *BaseMode) GetSelectItems() []*terminal.SelectItem + func (b *BaseMode) IsKey(k Keymap) bool + func (b *BaseMode) SetEventKey(ev *tcell.EventKey) + func (b *BaseMode) SetKeymapFn(fn KeymapFn) *BaseMode + func (b *BaseMode) SetKeymaps(k []Keymap) *BaseMode + func (b *BaseMode) SetPrevCommand(c Command) + func (b *BaseMode) SetSelectItems(items []*terminal.SelectItem) + func (b BaseMode) GetMode() Mode + type Client struct + func NewClient(t *terminal.Terminal) *Client + func (c *Client) ActionCopyMsg(msg string) error + func (c *Client) AppendSelectItem(item *terminal.SelectItem) *Client + func (c *Client) ClearSelectFiles() *Client + func (c *Client) DisableCache() *Client + func (c *Client) DisableFilter() *Client + func (c *Client) Download() error + func (c *Client) Draw() error + func (c *Client) DrawCache() error + func (c *Client) DrawCacheNormal() error + func (c *Client) DrawCommand() + func (c *Client) DrawConfirm() + func (c *Client) DrawDetail() + func (c *Client) DrawInput(prefix, text string) + func (c *Client) DrawInputKey() + func (c *Client) DrawLeft() error + func (c *Client) DrawMessage(text string) + func (c *Client) DrawMid() error + func (c *Client) DrawMidData() error + func (c *Client) DrawNormal() error + func (c *Client) DrawTitle(text string) + func (c *Client) EnableCache() *Client + func (c *Client) EnableModeNormal() *Client + func (c *Client) Enter() error + func (c *Client) Exec() error + func (c *Client) GetLeftDir() string + func (c *Client) GetMidDir() string + func (c *Client) GetMidSelectFile() *bdpan.FileInfoDto + func (c *Client) GetMidSelectItems() []*terminal.SelectItem + func (c *Client) GetMidSelectSystem() *SystemInfo + func (c *Client) GetMode() Mode + func (c *Client) GetModeDrawRange() (StartX, StartY, EndX, EndY int) + func (c *Client) GetModeNormalEndY() int + func (c *Client) GetSelectFile() *bdpan.FileInfoDto + func (c *Client) GetSelectFilePaths() []string + func (c *Client) GetSelectNames() []string + func (c *Client) HandleCommandKeymap(k Keymap) error + func (c *Client) HandleCommonKeymap(k Keymap) error + func (c *Client) HandleConfirmKeymap(k Keymap) error + func (c *Client) HandleEventKey() error + func (c *Client) HandleHelpKeymap(k Keymap) error + func (c *Client) HandleKeymapKeymap(k Keymap) error + func (c *Client) HandleNormalKeymap(k Keymap) error + func (c *Client) HandleSyncKeymap(k Keymap) error + func (c *Client) IsKeymapK(k Keymap) bool + func (c *Client) MoveDown(step int) + func (c *Client) MoveLeft() + func (c *Client) MoveUp(step int) + func (c *Client) NewNormalMode() *NormalMode + func (c *Client) RefreshUsed() error + func (c *Client) RemoveSelectItem(item *terminal.SelectItem) *Client + func (c *Client) SetCommandMode(nextMode ModeInterface) *Client + func (c *Client) SetConfirmMode(ensureC Command, msg string) *Client + func (c *Client) SetCurrSelectFiles() *Client + func (c *Client) SetHelpMode() *Client + func (c *Client) SetKeymapMode() *Client + func (c *Client) SetM(m ModeInterface) *Client + func (c *Client) SetMidFile(file *bdpan.FileInfoDto) *Client + func (c *Client) SetMode(m Mode) *Client + func (c *Client) SetNormalAction(a SystemAction) *Client + func (c *Client) SetNormalMode() *Client + func (c *Client) SetSelectItems() *Client + func (c *Client) SetSyncMode() *Client + func (c *Client) SetUser(u *bdpan.UserInfoDto) *Client + func (c *Client) ShowSystem() + func (c Client) Size() (w, h int) + type CollectInfo struct + CreateTime time.Time + File *bdpan.FileInfoDto + func NewCollect(file *bdpan.FileInfoDto) CollectInfo + type Command string + type CommandFn func(Command) error + type CommandMode struct + Input string + NextMode ModeInterface + Prefix string + func NewCommandMode(prefix string) *CommandMode + func (c *CommandMode) GetKeymap() Keymap + func (m *CommandMode) SetInput(t string) *CommandMode + func (m *CommandMode) SetNextMode(mi ModeInterface) *CommandMode + type ConfirmMode struct + EnsureCommand Command + Msg string + Term *terminal.Confirm + func NewConfirmMode(t *terminal.Terminal, ensureC Command, msg string) *ConfirmMode + type DownloadCommand struct + From string + IsRecursion bool + IsSync bool + IsVerbose bool + OutputDir string + OutputPath string + func (d DownloadCommand) Download(file *bdpan.FileInfoDto) error + func (d DownloadCommand) Run() error + type FileInfo struct + Count int + IsSync bool + MaxTextWidth int + func (i FileInfo) Id() string + func (i FileInfo) Name() string + func (i FileInfo) String() string + type FileSelectCache struct + Dir string + Files []*bdpan.FileInfoDto + SelectIndex int + func GetFileSelectCache(dir string) *FileSelectCache + func NewFileSelectCache(dir string, s *terminal.Select, files []*bdpan.FileInfoDto) *FileSelectCache + func (f *FileSelectCache) Save() + type HelpMode struct + Term *terminal.Help + func NewHelpMode(t *terminal.Terminal, fromMode Mode, StartX, StartY, EndX, EndY int) *HelpMode + func (h *HelpMode) Draw() error + type Keymap struct + Command Command + CommandString string + Desc string + Key tcell.Key + Keys []string + Msg string + R rune + RelKeys []Keymap + func NewKeymapN(keys []string, c Command) Keymap + func (k Keymap) AddRelKey(km Keymap) Keymap + func (k Keymap) GetKey() string + func (k Keymap) IsKey(currEK *tcell.EventKey, prevEK *tcell.EventKey) bool + func (k Keymap) IsNil() bool + func (k Keymap) SetCommandString(c string) Keymap + func (k Keymap) SetDesc(d string) Keymap + type KeymapAction int + type KeymapFn func(Keymap) error + type KeymapMode struct + Term *terminal.List + func NewKeymapMode(t *terminal.Terminal, currEK *tcell.EventKey) *KeymapMode + func (k *KeymapMode) Draw() error + type Mode string + type ModeInterface interface + AppendSelectItems func(*terminal.SelectItem) + ClearPrevCommand func() + ClearSelectItems func() + Draw func() error + GetKeymap func() Keymap + GetKeymapFn func() KeymapFn + GetKeymaps func() []Keymap + GetMode func() Mode + GetPrevCommand func() Command + GetSelectItems func() []*terminal.SelectItem + IsKey func(Keymap) bool + SetEventKey func(ev *tcell.EventKey) + SetPrevCommand func(c Command) + SetSelectItems func([]*terminal.SelectItem) + type NormalMode struct + func NewNormalMode() *NormalMode + func (n *NormalMode) GetKeymap() Keymap + type SyncInfo struct + MaxTextWidth int + func (i SyncInfo) Id() string + func (i SyncInfo) Name() string + func (i SyncInfo) String() string + type SyncMode struct + SelectItem *terminal.SelectItem + Term *terminal.Select + func NewSyncMode(t *terminal.Terminal, item *terminal.SelectItem, ...) *SyncMode + func (s *SyncMode) Count() int + func (s *SyncMode) Draw() error + type SystemAction int + const ActionBigFile + const ActionCollect + const ActionFile + const ActionSync + const ActionSystem + type SystemInfo struct + Action SystemAction + Icon string + func (i SystemInfo) Id() string + func (i SystemInfo) Name() string + func (i SystemInfo) String() string