types

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StorageTypeDisplay = map[StorageType]string{
	StorageTypeLocal:  "本地磁盘",
	StorageTypeWebdav: "WebDAV",
	StorageTypeAlist:  "Alist",
}

Functions

This section is empty.

Types

type File added in v0.4.0

type File struct {
	Location tg.InputFileLocationClass
	FileSize int64
	FileName string
}

func (File) Hash added in v0.10.1

func (f File) Hash() string

type StorageType

type StorageType string
var (
	StorageTypeLocal  StorageType = "local"
	StorageTypeWebdav StorageType = "webdav"
	StorageTypeAlist  StorageType = "alist"
)

type Task

type Task struct {
	Ctx         context.Context
	Cancel      context.CancelFunc
	Error       error
	Status      TaskStatus
	File        *File
	StorageName string
	StoragePath string
	StartTime   time.Time

	FileMessageID int
	FileChatID    int64
	// to track the reply message
	ReplyMessageID int
	ReplyChatID    int64
	// to track the user
	UserID int64
}

func (Task) FileName

func (t Task) FileName() string

func (Task) Key added in v0.14.0

func (t Task) Key() string

func (Task) String

func (t Task) String() string

type TaskStatus

type TaskStatus string
var (
	Pending   TaskStatus = "pending"
	Succeeded TaskStatus = "succeeded"
	Failed    TaskStatus = "failed"
	Canceled  TaskStatus = "canceled"
)

Jump to

Keyboard shortcuts

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