util

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package util contains various small helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeValidator

func CodeValidator(input string) error

CodeValidator provides a validator for wormhole codes.

func TeeReader

func TeeReader(r io.Reader, p *ProgressBar) io.Reader

TeeReader returns a wrapped Reader that updates the progress bar.

func TeeReaderAt

func TeeReaderAt(r io.ReaderAt, p *ProgressBar) io.ReaderAt

TeeReaderAt returns a wrapped ReaderAt that updates the progress bar.

func UserDownloadsFolder

func UserDownloadsFolder() string

UserDownloadsFolder returns the downloads folder corresponding to the current user.

func WindowSizeToDialog

func WindowSizeToDialog(s fyne.Size) fyne.Size

WindowSizeToDialog scales the window size to a suitable dialog size.

Types

type ProgressBar

type ProgressBar struct {
	widget.ProgressBar
}

ProgressBar is contains a widget for displaying wormhole send progress.

func NewProgressBar

func NewProgressBar() *ProgressBar

NewProgressBar creates a new fyne progress bar and update function for wormhole send.

func (*ProgressBar) Done

func (p *ProgressBar) Done()

Done sets the value to max to indicate that it is finished.

func (*ProgressBar) Failed

func (p *ProgressBar) Failed()

Failed sets the text to indicate a failure.

func (*ProgressBar) WithProgress

func (p *ProgressBar) WithProgress() wormhole.SendOption

WithProgress returns a send option to update the progress.

Jump to

Keyboard shortcuts

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