service

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConnectionEstablished 表示连接已建立后断开(需要立即重连)
	ErrConnectionEstablished = errors.New("connection was established")
)

定义特殊错误类型

Functions

func GetVersion

func GetVersion() string

GetVersion 获取 Agent 版本号

func UninstallAgent added in v0.0.19

func UninstallAgent(cfgPath string) error

UninstallAgent 执行探针卸载操作(可被复用)

Types

type Agent

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

Agent 探针服务

func New

func New(cfg *config.Config) *Agent

New 创建 Agent 实例

func (*Agent) Start

func (a *Agent) Start(ctx context.Context) error

Start 启动探针服务

func (*Agent) Stop

func (a *Agent) Stop()

Stop 停止探针服务

type ServiceManager

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

ServiceManager 服务管理器

func NewServiceManager

func NewServiceManager(cfg *config.Config) (*ServiceManager, error)

NewServiceManager 创建服务管理器

func (*ServiceManager) Install

func (m *ServiceManager) Install() error

Install 安装服务

func (*ServiceManager) Restart

func (m *ServiceManager) Restart() error

Restart 重启服务

func (*ServiceManager) Run

func (m *ServiceManager) Run() error

Run 运行服务(用于 service run 命令)

func (*ServiceManager) Start

func (m *ServiceManager) Start() error

Start 启动服务

func (*ServiceManager) Status

func (m *ServiceManager) Status() (string, error)

Status 查看服务状态

func (*ServiceManager) Stop

func (m *ServiceManager) Stop() error

Stop 停止服务

func (*ServiceManager) Uninstall

func (m *ServiceManager) Uninstall() error

Uninstall 卸载服务

Jump to

Keyboard shortcuts

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