daemon

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Daemonize

func Daemonize() error

Daemonize 尝试将当前程序作为守护进程运行

func IsDaemon

func IsDaemon() bool

IsDaemon 检查当前进程是否作为守护进程运行

Types

type ServiceManager

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

ServiceManager 结构体封装了服务管理的核心功能

func NewServiceManager

func NewServiceManager(name, displayName, description string) (*ServiceManager, error)

NewServiceManager 创建一个新的 ServiceManager 实例

func (*ServiceManager) Control

func (sm *ServiceManager) Control(action string) error

Control 控制服务(启动、停止、重启等)

func (*ServiceManager) Run

func (sm *ServiceManager) Run() error

Run 运行服务

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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