widgets

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSwitch = errors.New("switch")

Functions

func Colorize

func Colorize(name string, content []byte, out io.Writer) error

func Form

func Form(c params.CLIContext, sshOptions bool) (params.CLIContext, error)

func ShowFile

func ShowFile(fname string, content []byte, external bool) error

func ShowFileInternal

func ShowFileInternal(fname string, content []byte) error

func ShowFileInternalWidget

func ShowFileInternalWidget(fname string, content []byte) (*tview.TextView, error)

func TableOfFiles

func TableOfFiles(wd string, callback SelectedCallback, readFile func(string) ([]byte, error), remote bool) error

Types

type SelectedAction

type SelectedAction uint8
const (
	Init SelectedAction = iota
	OpenDir
	OpenFile
	DeleteFile
	DeleteDir
	EditFile
)

type SelectedCallback

type SelectedCallback func(*SelectedFile) ([]os.FileInfo, error)

type SelectedFile

type SelectedFile struct {
	Name     string
	Size     int64
	Mode     os.FileMode
	Position int
	Action   SelectedAction
	IsDir    bool
	Err      error
}

type UFiles

type UFiles struct {
	AllFiles   []sys.UFile
	Dirs       []sys.UFile
	Regulars   []sys.UFile
	Irregulars []sys.UFile
}

func (*UFiles) Init

func (all *UFiles) Init(files []os.FileInfo, remote bool) *UFiles

Jump to

Keyboard shortcuts

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