types

package
v0.20.7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type ContextKey added in v0.19.0

type ContextKey string
const (
	ContextKeyContentLength ContextKey = "content-length"
)

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 RuleType added in v0.20.0

type RuleType string
const (
	RuleTypeFileNameRegex RuleType = "FILENAME-REGEX"
	RuleTypeMessageRegex  RuleType = "MESSAGE-REGEX"
)

type StorageType

type StorageType string
const (
	StorageTypeLocal  StorageType = "local"
	StorageTypeWebdav StorageType = "webdav"
	StorageTypeAlist  StorageType = "alist"
	StorageTypeMinio  StorageType = "minio"
)

type Task

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

	File          *File
	FileMessageID int
	FileChatID    int64

	IsTelegraph  bool
	TelegraphURL string

	// to track the reply message
	ReplyMessageID int
	ReplyChatID    int64
	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
const (
	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