uploader

package
v0.17.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elem

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

type File

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

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

type Progress

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

type ProgressState

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