media

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStatus

type CacheStatus struct {
	IsRunning bool   `json:"isRunning"`
	Total     int    `json:"total"`
	Processed int    `json:"processed"`
	Scope     string `json:"scope"`
}

CacheStatus 缓存任务进度

type PreparedMedia

type PreparedMedia struct {
	Content     []byte
	ContentType string
	Error       error
}

PreparedMedia 保存媒体文件的最终内容和内容类型。

type Service

type Service struct {
	DataDir         string
	ImageKey        string
	XorKey          string
	WechatDbSrcPath string
	// contains filtered or unexported fields
}

Service 处理准备用于服务的媒体文件的业务逻辑。

func NewService

func NewService(dataDir, imageKey, xorKey, wechatDbSrcPath string) *Service

NewService 创建一个新的媒体服务。

func (*Service) DownloadAndDecryptEmoji

func (s *Service) DownloadAndDecryptEmoji(url string, keyHex string) PreparedMedia

DownloadAndDecryptEmoji 下载并解密表情包

func (*Service) GetCacheStatus

func (s *Service) GetCacheStatus() CacheStatus

func (*Service) Prepare

func (s *Service) Prepare(media *model.Media, isThumb bool) PreparedMedia

Prepare 处理获取、读取和解码媒体文件的完整生命周期。

func (*Service) StartCacheTask

func (s *Service) StartCacheTask(scope string, talker string) error

Jump to

Keyboard shortcuts

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