Documentation
¶
Index ¶
- type SystemdAdapter
- func (s *SystemdAdapter) IsActive(serviceName string) (bool, error)
- func (s *SystemdAdapter) Restart(serviceName string) error
- func (s *SystemdAdapter) Start(serviceName string) error
- func (s *SystemdAdapter) Status(serviceName string) (string, error)
- func (s *SystemdAdapter) Stop(serviceName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SystemdAdapter ¶
type SystemdAdapter struct {
// contains filtered or unexported fields
}
SystemdAdapter systemd 适配器
func NewSystemdAdapter ¶
func NewSystemdAdapter(isUserUnit bool) *SystemdAdapter
NewSystemdAdapter 创建 systemd 适配器
func (*SystemdAdapter) IsActive ¶
func (s *SystemdAdapter) IsActive(serviceName string) (bool, error)
IsActive 检查服务是否激活
func (*SystemdAdapter) Restart ¶
func (s *SystemdAdapter) Restart(serviceName string) error
Restart 重启服务
Click to show internal directories.
Click to hide internal directories.