types

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 7 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 ReceivedFile added in v0.4.0

type ReceivedFile struct {
	gorm.Model
	Processing bool
	// Which chat the file is from
	ChatID int64 `gorm:"uniqueIndex:idx_chat_id_message_id;not null"`
	// Which message the file is from
	MessageID      int `gorm:"uniqueIndex:idx_chat_id_message_id;not null"`
	ReplyMessageID int
	ReplyChatID    int64
	FileName       string
}

type StorageType

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

type Task

type Task struct {
	Ctx         context.Context
	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) String

func (t Task) String() string

type TaskStatus

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

type User added in v0.4.0

type User struct {
	gorm.Model
	ChatID         int64 `gorm:"uniqueIndex;not null"`
	Silent         bool
	DefaultStorage string // Default storage name
}

Jump to

Keyboard shortcuts

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