task

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpansionInput added in v1.3.0

type ExpansionInput struct {
	PanAccountID uint                   `json:"pan_account_id"`
	DataSource   map[string]interface{} `json:"data_source,omitempty"`
}

ExpansionInput 扩容任务输入数据结构

type ExpansionOutput added in v1.3.0

type ExpansionOutput struct {
	Success              bool                  `json:"success"`
	Message              string                `json:"message"`
	Error                string                `json:"error,omitempty"`
	Time                 string                `json:"time"`
	TransferredResources []TransferredResource `json:"transferred_resources,omitempty"`
}

ExpansionOutput 扩容任务输出数据结构

type ExpansionProcessor added in v1.3.0

type ExpansionProcessor struct {
	// contains filtered or unexported fields
}

ExpansionProcessor 扩容任务处理器

func NewExpansionProcessor added in v1.3.0

func NewExpansionProcessor(repoMgr *repo.RepositoryManager) *ExpansionProcessor

NewExpansionProcessor 创建扩容任务处理器

func (*ExpansionProcessor) GetTaskType added in v1.3.0

func (ep *ExpansionProcessor) GetTaskType() string

GetTaskType 获取任务类型

func (*ExpansionProcessor) Process added in v1.3.0

func (ep *ExpansionProcessor) Process(ctx context.Context, taskID uint, item *entity.TaskItem) error

Process 处理扩容任务项

type GoogleIndexProcessor added in v1.3.5

type GoogleIndexProcessor struct {
	// contains filtered or unexported fields
}

GoogleIndexProcessor Google索引任务处理器

func NewGoogleIndexProcessor added in v1.3.5

func NewGoogleIndexProcessor(repoMgr *repo.RepositoryManager) *GoogleIndexProcessor

NewGoogleIndexProcessor 创建Google索引任务处理器

func (*GoogleIndexProcessor) BatchProcessURLs added in v1.3.5

func (gip *GoogleIndexProcessor) BatchProcessURLs(ctx context.Context, urls []string, operation string, taskID uint) error

BatchProcessURLs 批量处理URLs

func (*GoogleIndexProcessor) GetTaskType added in v1.3.5

func (gip *GoogleIndexProcessor) GetTaskType() string

GetTaskType 获取任务类型

func (*GoogleIndexProcessor) Process added in v1.3.5

func (gip *GoogleIndexProcessor) Process(ctx context.Context, taskID uint, item *entity.TaskItem) error

Process 处理Google索引任务项

func (*GoogleIndexProcessor) SubmitSitemap added in v1.3.5

func (gip *GoogleIndexProcessor) SubmitSitemap(ctx context.Context, sitemapURL string, taskID uint) error

SubmitSitemap 提交网站地图

type GoogleIndexProcessorConfig added in v1.3.5

type GoogleIndexProcessorConfig struct {
	CredentialsFile string
	SiteURL         string
	TokenFile       string
	Concurrency     int
	RetryAttempts   int
	RetryDelay      time.Duration
}

GoogleIndexProcessorConfig Google索引处理器配置

type GoogleIndexTaskInput added in v1.3.5

type GoogleIndexTaskInput struct {
	URLs       []string `json:"urls"`
	Operation  string   `json:"operation"` // indexing_check, sitemap_submit, batch_index
	SitemapURL string   `json:"sitemap_url,omitempty"`
}

GoogleIndexTaskInput Google索引任务输入数据结构

type GoogleIndexTaskOutput added in v1.3.5

type GoogleIndexTaskOutput struct {
	URL         string                      `json:"url,omitempty"`
	IndexStatus string                      `json:"index_status,omitempty"`
	Error       string                      `json:"error,omitempty"`
	Success     bool                        `json:"success"`
	Message     string                      `json:"message"`
	Time        string                      `json:"time"`
	Result      *google.URLInspectionResult `json:"result,omitempty"`
}

GoogleIndexTaskOutput Google索引任务输出数据结构

type ShareInfo

type ShareInfo struct {
	PanType string
	ShareID string
	URL     string
}

ShareInfo 分享信息结构

type TaskManager

type TaskManager struct {
	// contains filtered or unexported fields
}

TaskManager 任务管理器

func NewTaskManager

func NewTaskManager(repoMgr *repo.RepositoryManager) *TaskManager

NewTaskManager 创建任务管理器

func (*TaskManager) CreateTask added in v1.3.5

func (tm *TaskManager) CreateTask(taskType, name, description string, configID *uint) (*entity.Task, error)

CreateTask 创建任务

func (*TaskManager) CreateTaskItems added in v1.3.5

func (tm *TaskManager) CreateTaskItems(taskID uint, items []*entity.TaskItem) error

CreateTaskItems 创建任务项

func (*TaskManager) GetTask added in v1.3.5

func (tm *TaskManager) GetTask(taskID uint) (*entity.Task, error)

GetTask 获取任务详情

func (*TaskManager) GetTaskItemStats added in v1.3.5

func (tm *TaskManager) GetTaskItemStats(taskID uint) (map[string]int, error)

GetTaskItemStats 获取任务项统计信息

func (*TaskManager) GetTaskStatus

func (tm *TaskManager) GetTaskStatus(taskID uint) (string, error)

GetTaskStatus 获取任务状态

func (*TaskManager) IsTaskRunning

func (tm *TaskManager) IsTaskRunning(taskID uint) bool

IsTaskRunning 检查任务是否在运行

func (*TaskManager) PauseTask

func (tm *TaskManager) PauseTask(taskID uint) error

PauseTask 暂停任务

func (*TaskManager) QueryTaskItems added in v1.3.5

func (tm *TaskManager) QueryTaskItems(taskID uint, page, pageSize int, status string) ([]*entity.TaskItem, int64, error)

QueryTaskItems 查询任务项

func (*TaskManager) RecoverRunningTasks

func (tm *TaskManager) RecoverRunningTasks() error

RecoverRunningTasks 恢复运行中的任务(服务器重启后调用)

func (*TaskManager) RegisterProcessor

func (tm *TaskManager) RegisterProcessor(processor TaskProcessor)

RegisterProcessor 注册任务处理器

func (*TaskManager) StartTask

func (tm *TaskManager) StartTask(taskID uint) error

StartTask 启动任务

func (*TaskManager) StopTask

func (tm *TaskManager) StopTask(taskID uint) error

StopTask 停止任务

type TaskProcessor

type TaskProcessor interface {
	Process(ctx context.Context, taskID uint, item *entity.TaskItem) error
	GetTaskType() string
}

TaskProcessor 任务处理器接口

type TransferInput

type TransferInput struct {
	Title      string `json:"title"`
	URL        string `json:"url"`
	CategoryID uint   `json:"category_id"`
	PanID      uint   `json:"pan_id"`
	Tags       []uint `json:"tags"`
}

TransferInput 转存任务输入数据结构

type TransferOutput

type TransferOutput struct {
	ResourceID uint   `json:"resource_id,omitempty"`
	SaveURL    string `json:"save_url,omitempty"`
	Error      string `json:"error,omitempty"`
	Success    bool   `json:"success"`
	Time       string `json:"time"`
}

TransferOutput 转存任务输出数据结构

type TransferProcessor

type TransferProcessor struct {
	// contains filtered or unexported fields
}

TransferProcessor 转存任务处理器

func NewTransferProcessor

func NewTransferProcessor(repoMgr *repo.RepositoryManager) *TransferProcessor

NewTransferProcessor 创建转存任务处理器

func (*TransferProcessor) GetTaskType

func (tp *TransferProcessor) GetTaskType() string

GetTaskType 获取任务类型

func (*TransferProcessor) Process

func (tp *TransferProcessor) Process(ctx context.Context, taskID uint, item *entity.TaskItem) error

Process 处理转存任务项

type TransferResult

type TransferResult struct {
	Success  bool   `json:"success"`
	SaveURL  string `json:"save_url"`
	Fid      string `json:"fid`
	ErrorMsg string `json:"error_msg"`
}

TransferResult 转存结果

type TransferredResource added in v1.3.0

type TransferredResource struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

TransferredResource 转存成功的资源信息

Jump to

Keyboard shortcuts

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