util

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 7 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 URLToGitHubProject added in v3.6.0

func URLToGitHubProject(subpath string) *url.URL

URLToGitHubProject returns a pre-parsed link to a GitHub site starting from github.com/jacalz/rymdport.

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 with 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 (ProgressReader) Read added in v3.4.0

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

Read wraps the Reader and updates the progress bar.

type ProgressReaderAt added in v3.6.0

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

ProgressReaderAt is a reader wrapper that calls a function for each part content being read with ReatAt.

func NewProgressReaderAt added in v3.4.0

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

NewProgressReaderAt returns a wrapped ReaderAt that updates the progress bar.

func (ProgressReaderAt) ReadAt added in v3.6.0

func (p ProgressReaderAt) 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