Documentation ¶
Index ¶
- Constants
- Variables
- func ByteCountSI(b int64) string
- func ErrorCmd(err error) tea.Cmd
- func LogSeparator(width int) string
- func NewProgressBar() progress.Model
- func QuitCmd() tea.Cmd
- func TaskCmd(task string, cmd tea.Cmd) tea.Cmd
- func TopLevelFilesText(fileNames []string) string
- func VersionCmd(ctx context.Context, rendezvousAddr string) tea.Cmd
- type ErrorMsg
- type KeyMap
- type ProgressMsg
- type SecureMsg
- type TransferStateMessage
- type TransferTypeMsg
- type VersionMsg
Constants ¶
View Source
const ( MARGIN = 2 PADDING = 1 MAX_WIDTH = 80 PRIMARY_COLOR = "#B8BABA" SECONDARY_COLOR = "#626262" DARK_COLOR = "#232323" ELEMENT_COLOR = "#EE9F40" SECONDARY_ELEMENT_COLOR = "#e87d3e" ERROR_COLOR = "#CC0000" WARNING_COLOR = "#EE9F5C" CHECK_COLOR = "#34B233" SHUTDOWN_PERIOD = 500 * time.Millisecond TEMP_UI_MESSAGE_DURATION = 2 * time.Second )
Variables ¶
View Source
var BaseStyle = lipgloss.NewStyle()
View Source
var BoldText = BaseStyle.Copy().Bold(true).Render
View Source
var CompressingSpinner = spinner.Spinner{ Frames: []string{"┉┉┉", "┅┅┅", "┄┄┄", "┉ ┉", "┅ ┅", "┄ ┄", " ┉ ", " ┉ ", " ┅ ", " ┅ ", " ┄ "}, FPS: time.Second / 3, }
View Source
var CopyKeyActiveHelpText = SuccessText("✓") + HelpStyle(" password → clipboard")
View Source
var CopyKeyHelpText = BaseStyle.Render("password → clipboard")
View Source
var ErrorText = BaseStyle.Copy().Foreground(lipgloss.Color(ERROR_COLOR)).Render
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 Keys = KeyMap{ Quit: key.NewBinding( key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("(q)", "quit"), ), CopyPassword: key.NewBinding( key.WithKeys("c"), key.WithHelp("(c)", CopyKeyHelpText), key.WithDisabled(), ), FileListUp: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("(↑/k)", "file summary up"), key.WithDisabled(), ), FileListDown: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("(↓/j)", "file summary down"), key.WithDisabled(), ), OverwritePromptYes: key.NewBinding( key.WithKeys("y", "Y"), key.WithHelp("(Y/y)", "accept overwrite"), key.WithDisabled(), ), OverwritePromptNo: key.NewBinding( key.WithKeys("n", "N"), key.WithHelp("(N/n)", "deny overwrite"), key.WithDisabled(), ), OverwritePromptConfirm: key.NewBinding( key.WithKeys("enter"), key.WithHelp("(⏎ )", "confirm choice"), key.WithDisabled(), ), }
View Source
var PadText = strings.Repeat(" ", MARGIN)
View Source
var ReceivingSpinner = spinner.Spinner{ Frames: []string{"┄┄┄", "┄┄⇠", "┄⇠┄", "⇠┄┄"}, FPS: time.Second / 2, }
View Source
var SuccessText = BaseStyle.Copy().Foreground(lipgloss.Color(CHECK_COLOR)).Render
View Source
var TransferSpinner = spinner.Spinner{ Frames: []string{"⇢┄┄", "┄⇢┄", "┄┄⇢", "┄┄┄"}, FPS: time.Millisecond * 400, }
View Source
var WaitingSpinner = spinner.Spinner{ Frames: []string{"⠋ ", "⠙ ", "⠹ ", "⠸ ", "⠼ ", "⠴ ", "⠦ ", "⠧ ", "⠇ ", "⠏ "}, FPS: time.Second / 12, }
View Source
var WarningText = BaseStyle.Copy().Foreground(lipgloss.Color(WARNING_COLOR)).Render
Functions ¶
func ByteCountSI ¶
Credits to (legendary Mr. Nilsson): https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
func LogSeparator ¶
func NewProgressBar ¶
func TopLevelFilesText ¶
Types ¶
type KeyMap ¶
type ProgressMsg ¶
type ProgressMsg int
type TransferStateMessage ¶
type TransferTypeMsg ¶
type VersionMsg ¶
Click to show internal directories.
Click to hide internal directories.