uploadutil

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Upload

func Upload(c *gotktrix.Client, r io.ReadCloser, name string) (matrix.URL, error)

Upload wraps around a reader to peek for its MIME type.

func WrapCloser

func WrapCloser(r io.Reader, c io.Closer) io.ReadCloser

WrapCloser wraps a reader around a closer.

func WrapProgressReader

func WrapProgressReader(b *ProgressBar, r io.ReadCloser) io.ReadCloser

WrapProgressReader wraps a ProgressBar to update it when the reader is read from.

Types

type ProgressBar

type ProgressBar struct {
	*gtk.ProgressBar
	// contains filtered or unexported fields
}

ProgressBar is a wrapper around gtk.ProgressBar.

func NewProgressBar

func NewProgressBar() *ProgressBar

func (*ProgressBar) Done

func (p *ProgressBar) Done(err bool)

Done marks the progress bar as done. This method is safe to use concurrently.

func (*ProgressBar) Error

func (p *ProgressBar) Error()

Error sets an error.

func (*ProgressBar) Read

func (p *ProgressBar) Read(bytes int64)

Read increments the bytes read. This method is safe to use concurrently.

func (*ProgressBar) Reset

func (p *ProgressBar) Reset()

Reset resets the progress bar.

func (*ProgressBar) SetTotal

func (p *ProgressBar) SetTotal(bytes int64)

SetTotal sets the total number of bytes to upload. This method is safe to use concurrently.

Jump to

Keyboard shortcuts

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