ui

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PADDING                 = 2
	MAX_WIDTH               = 80
	PRIMARY_COLOR           = "#B8BABA"
	SECONDARY_COLOR         = "#626262"
	ELEMENT_COLOR           = "#EE9F40"
	SECONDARY_ELEMENT_COLOR = "#EE9F70"
	START_PERIOD            = 1 * time.Millisecond
	SHUTDOWN_PERIOD         = 500 * time.Millisecond
)

Variables

View Source
var BoldText = baseStyle.Copy().Bold(true).Render
View Source
var CompressingSpinner = spinner.Spinner{
	Frames: []string{"┉┉┉", "┅┅┅", "┄┄┄", "┉ ┉", "┅ ┅", "┄ ┄", " ┉ ", " ┉ ", " ┅ ", " ┅ ", " ┄ "},
	FPS:    time.Second / 3,
}
View Source
var HelpStyle = baseStyle.Copy().Foreground(lipgloss.Color(SECONDARY_COLOR)).Render
View Source
var InfoStyle = baseStyle.Copy().Foreground(lipgloss.Color(PRIMARY_COLOR)).Render
View Source
var ItalicText = baseStyle.Copy().Italic(true).Render
View Source
var PadText = strings.Repeat(" ", PADDING)
View Source
var QuitCommandsHelpText = HelpStyle(fmt.Sprintf("(any of [%s] to abort)", (strings.Join(QuitKeys, ", "))))
View Source
var QuitKeys = []string{"ctrl+c", "q", "esc"}
View Source
var ReceivingSpinner = spinner.Spinner{
	Frames: []string{"   ", "  «", " ««", "«««"},
	FPS:    time.Second / 2,
}
View Source
var TransferSpinner = spinner.Spinner{
	Frames: []string{"»  ", "»» ", "»»»", "   "},
	FPS:    time.Millisecond * 400,
}
View Source
var WaitingSpinner = spinner.Spinner{
	Frames: []string{"⠋ ", "⠙ ", "⠹ ", "⠸ ", "⠼ ", "⠴ ", "⠦ ", "⠧ ", "⠇ ", "⠏ "},
	FPS:    time.Second / 12,
}

Functions

func ByteCountSI

func ByteCountSI(b int64) string

Credits to (legendary Mr. Nilsson): https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/

func QuitCmd

func QuitCmd() tea.Cmd

func TopLevelFilesText

func TopLevelFilesText(fileNames []string) string

Types

type ErrorMsg

type ErrorMsg error

type ProgressMsg

type ProgressMsg int

type SecureMsg

type SecureMsg struct {
	Conn conn.Transfer
}

type TransferTypeMsg

type TransferTypeMsg struct {
	Type transfer.Type
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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