jservice

package module
v0.0.0-...-5eeebed Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Linux_Server_Net  = "network.target"
	Linux_Server_Sshd = "sshd.service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseService

type BaseService struct {
	ExeFile string
	ExeName string
	ExePath string
	Params  string
	After   []string
}

func (BaseService) ParseFile

func (b BaseService) ParseFile(file string) (string, string)

func (BaseService) RunCmd

func (b BaseService) RunCmd(name string, params ...string) (string, error)

func (BaseService) RunCmdGbk

func (b BaseService) RunCmdGbk(name string, params ...string) (string, error)

type IService

type IService interface {
	Install() (string, error)
	UnInstall() (string, error)
	Start() (string, error)
	Stop() (string, error)
	AddAfter(n string)
	Reload() (string, error)
}

func New

func New(file string, params string) (IService, error)

type LinuxService

type LinuxService struct {
	BaseService
}

func (LinuxService) AddAfter

func (s LinuxService) AddAfter(n string)

func (LinuxService) Install

func (s LinuxService) Install() (string, error)

func (LinuxService) MakeService

func (s LinuxService) MakeService()

func (LinuxService) Reload

func (s LinuxService) Reload() (string, error)

func (LinuxService) Start

func (s LinuxService) Start() (string, error)

func (LinuxService) Stop

func (s LinuxService) Stop() (string, error)

func (LinuxService) UnInstall

func (s LinuxService) UnInstall() (string, error)

type WinService

type WinService struct {
	BaseService
}

func (WinService) AddAfter

func (s WinService) AddAfter(n string)

func (WinService) Install

func (s WinService) Install() (string, error)

func (WinService) Reload

func (s WinService) Reload() (string, error)

func (WinService) Start

func (s WinService) Start() (string, error)

func (WinService) Stop

func (s WinService) Stop() (string, error)

func (WinService) UnInstall

func (s WinService) UnInstall() (string, error)

Jump to

Keyboard shortcuts

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