util

package
v3.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 6 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 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 ProgressReader added in v3.4.0

type ProgressReader struct {
	Max int64
	// contains filtered or unexported fields
}

ProgressReader is a reader wrapper that calls a function for each part content being read.

func NewProgressReader added in v3.4.0

func NewProgressReader(r io.Reader, p func(delta int64, max int64), max int64) *ProgressReader

NewProgressReader returns a wrapped Reader that updates the progress bar.

func NewProgressReaderAt added in v3.4.0

func NewProgressReaderAt(r io.ReaderAt, p func(delta int64, max int64), max int64) *ProgressReader

NewProgressReaderAt returns a wrapped ReaderAt that updates the progress bar.

func (*ProgressReader) Read added in v3.4.0

func (p *ProgressReader) Read(buf []byte) (int, error)

Read wraps the Reader and updates the progress bar.

func (*ProgressReader) ReadAt added in v3.4.0

func (p *ProgressReader) ReadAt(buf []byte, off int64) (int, error)

ReadAt wraps the ReaderAt and updates the progress bar.

Jump to

Keyboard shortcuts

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