cmd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS> doc: https://pan.baidu.com/union/doc/pkuo3snyp

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	ORDER_TIME = "time"
	ORDER_NAME = "name"
	ORDER_SIZE = "size"
)
View Source
const (
	ActionSync bdpan.SelectAction = iota
)

Variables

View Source
var (
	Log = bdpan.GetLogger()
)

Functions

func DrawText

func DrawText(s tcell.Screen, StartX, StartY, EndX, EndY int, style tcell.Style, text string) error

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type AuthCommand

type AuthCommand struct {
}

func (AuthCommand) Run

func (a AuthCommand) Run() error

type Box

type Box struct {
	StartX int
	StartY int
	EndX   int
	EndY   int
	Style  tcell.Style
}

func NewBox

func NewBox(StartX, StartY, EndX, EndY int, Style tcell.Style) *Box

func (Box) DrawRange

func (b Box) DrawRange() (StartX, StartY, EndX, EndY int)

func (*Box) DrawText

func (b *Box) DrawText(s tcell.Screen, style tcell.Style, text string)

type DownloadCommand

type DownloadCommand struct {
	From string

	IsSync bool
	// contains filtered or unexported fields
}

func NewDownloadCommand

func NewDownloadCommand(c *cobra.Command) *DownloadCommand

func (DownloadCommand) Download

func (d DownloadCommand) Download(file *bdpan.FileInfoDto) error

func (DownloadCommand) Run

func (d DownloadCommand) Run() error

type GlobalArg

type GlobalArg struct {
	IsVerbose bool
	AppId     string
}

type ListCommand

type ListCommand struct {
	Dir         string
	IsRecursion bool
	IsDesc      bool
	Start       int32
	Limit       int32
	Order       string
}

func NewListCommand

func NewListCommand(c *cobra.Command) *ListCommand

func (ListCommand) Run

func (l ListCommand) Run() error

type LoginCommand

type LoginCommand struct {
}

func (LoginCommand) Run

func (l LoginCommand) Run() error

type ManageCommand

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

func (ManageCommand) Copy

func (m ManageCommand) Copy() error

func (ManageCommand) Exec

func (m ManageCommand) Exec(args []string) error

type Mode

type Mode int
const (
	ModeNormal Mode = iota
	ModeConfirm
)

type QueryArg

type QueryArg struct {
	Dir string
}

type QueryCommand

type QueryCommand struct {
	Key   string // 搜索关键字
	Path  string // 文件地址
	FSIDS []string
}

func NewQueryCommand

func NewQueryCommand(cmd *cobra.Command) *QueryCommand

func (QueryCommand) Run

func (q QueryCommand) Run() error

type RootCommand

type RootCommand struct {
	Path  string
	Limit int

	T *Terminal
	// contains filtered or unexported fields
}

func (*RootCommand) DrawBottomLeft

func (r *RootCommand) DrawBottomLeft(text string) error

左下角输入内容

func (*RootCommand) DrawBottomRight

func (r *RootCommand) DrawBottomRight(text string) error

右下角输入内容

func (*RootCommand) DrawEventKey

func (r *RootCommand) DrawEventKey(ev *tcell.EventKey) error

func (*RootCommand) DrawLayout

func (r *RootCommand) DrawLayout() error

画布局

func (*RootCommand) DrawSelect

func (r *RootCommand) DrawSelect() error

func (*RootCommand) DrawSelectItem

func (r *RootCommand) DrawSelectItem(s *Select)

绘制选中的 select item

func (*RootCommand) DrawTopLeft

func (r *RootCommand) DrawTopLeft(text string) error

左上角输入内容

func (*RootCommand) Exec

func (r *RootCommand) Exec(args []string) error

func (*RootCommand) GetSelectInfo

func (r *RootCommand) GetSelectInfo() *bdpan.FileInfoDto

获取被选中的文件对象

func (*RootCommand) InitScreen

func (r *RootCommand) InitScreen(file *bdpan.FileInfoDto) error

func (*RootCommand) ListenEventKeyInModeConfirm

func (r *RootCommand) ListenEventKeyInModeConfirm(ev *tcell.EventKey) error

func (*RootCommand) ListenEventKeyInModeNormal

func (r *RootCommand) ListenEventKeyInModeNormal(ev *tcell.EventKey) error

type Select

type Select struct {
	StartX      int
	StartY      int
	MaxWidth    int
	MaxHeight   int
	Items       []*SelectItem
	SelectIndex int
	StyleSelect tcell.Style
}

func (*Select) GetDrawItems

func (s *Select) GetDrawItems() []*SelectItem

func (Select) GetSeleteItem

func (s Select) GetSeleteItem() *SelectItem

func (*Select) MoveDownSelect

func (s *Select) MoveDownSelect(step int) (isChange bool)

func (*Select) MoveUpSelect

func (s *Select) MoveUpSelect(step int) (isChange bool)

type SelectItem

type SelectItem struct {
	IsSelect bool
	Info     interface{}
}

type SyncAddCommand

type SyncAddCommand struct {
	Remote   string
	Local    string
	IsBackup bool // 是否为备份
	HasHide  bool //是否备份隐藏文件
}

func (SyncAddCommand) Run

func (s SyncAddCommand) Run() error

type SyncCommand

type SyncCommand struct {
	ID string

	IsCmdDel  bool
	IsCmdList bool
}

func (SyncCommand) Run

func (s SyncCommand) Run() error

type SyncExecCommand

type SyncExecCommand struct {
	*SyncCommand
	// contains filtered or unexported fields
}

func (SyncExecCommand) Run

func (s SyncExecCommand) Run() error

type Terminal

type Terminal struct {
	S            tcell.Screen
	StyleDefault tcell.Style
}

func NewTerminal

func NewTerminal() (*Terminal, error)

func (*Terminal) DrawBox

func (t *Terminal) DrawBox(b Box) error

func (*Terminal) DrawLineText

func (t *Terminal) DrawLineText(StartX, StartY, MaxLineW int, style tcell.Style, text string) error

func (*Terminal) DrawText

func (t *Terminal) DrawText(StartX, StartY, EndX, EndY int, style tcell.Style, text string) error

func (*Terminal) Exec

func (t *Terminal) Exec() error

func (*Terminal) Quit

func (t *Terminal) Quit()

type TestCommand

type TestCommand struct {
	Cmd *cobra.Command
	ID  string
}

func (TestCommand) Init

func (t TestCommand) Init()

func (TestCommand) Run

func (t TestCommand) Run(cmd *cobra.Command, args []string)

type UploadCommand

type UploadCommand struct {
	From          string
	To            string
	IsSync        bool
	IsRecursion   bool // 是否递归子文件夹文件
	IsIncludeHide bool // 是否上传隐藏文件
	// contains filtered or unexported fields
}

func NewUploadCommand

func NewUploadCommand(c *cobra.Command) *UploadCommand

func (UploadCommand) Run

func (u UploadCommand) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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