uploader

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elem added in v0.13.1

type Elem interface {
	File() File
	Thumb() (File, bool)
	To() tg.InputPeerClass
	AsPhoto() bool
}

type File added in v0.13.1

type File interface {
	io.ReadSeeker
	Name() string
	Size() int64
}

type Iter

type Iter interface {
	Next(ctx context.Context) bool
	Value() Elem
	Err() error
}

type Options added in v0.7.0

type Options struct {
	Client   *tg.Client
	PartSize int
	Threads  int
	Iter     Iter
	Progress Progress
}

type Progress added in v0.13.1

type Progress interface {
	OnAdd(elem Elem)
	OnUpload(elem Elem, state ProgressState)
	OnDone(elem Elem, err error)
}

type ProgressState added in v0.13.1

type ProgressState struct {
	Uploaded int64
	Total    int64
}

type Uploader

type Uploader struct {
	// contains filtered or unexported fields
}

func New

func New(o Options) *Uploader

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, limit int) error

Jump to

Keyboard shortcuts

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