task

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package task 提供任务执行器的核心应用逻辑。 包含任务的初始化、配置加载和运行时管理等功能。

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(
	applog.NewLogger,
)

ProviderSet 是 wire 的依赖注入提供者集合。 包含了创建应用实例所需的所有依赖。

Functions

func NewServiceManager added in v0.0.5

func NewServiceManager(configPath string) (*serviceManager, error)

NewServiceManager 创建服务管理器。

参数:

  • configPath:配置文件路径。

返回:

  • *serviceManager:服务管理器实例。
  • error:初始化过程中可能发生的错误。

func Run

func Run()

Run 是 Task 应用的主入口。

主要流程:

  1. 解析命令行参数,识别并分发子命令(install、uninstall、run、help 等)。
  2. 若为 install/uninstall,调用对应处理函数后退出。
  3. 若为 run 或无子命令,则进入前台运行模式,调用 run() 启动服务。

该函数确保所有业务逻辑只在前台模式下启动,服务管理命令与业务解耦。

Types

This section is empty.

Jump to

Keyboard shortcuts

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