Documentation
¶
Index ¶
- Variables
- func AddCommandList()
- func Install(s *Service) (err error)
- func ListenAndServe_ServiceRpc(addr string, obj *ServiceRpc, psk *[32]byte) (closer func() error)
- func NewServer_ServiceRpc(obj *ServiceRpc, psk *[32]byte) http.Handler
- func Restart(name string) (err error)
- func RestartV1(name string) (err error)
- func ServiceStartFail()
- func ServiceStartSuccess()
- func SetClient_ServiceRpcConfig(RemoteAddr string, Psk *[32]byte)
- func Start(name string) (err error)
- func Stop(name string) (err error)
- func Uninstall(name string) (err error)
- type Client_ServiceRpc
- type FileMutex
- type Service
- type ServiceRpc
- type StartStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrServiceExist = errors.New("Service already exist")
Functions ¶
func AddCommandList ¶
func AddCommandList()
func ListenAndServe_ServiceRpc ¶
func ListenAndServe_ServiceRpc(addr string, obj *ServiceRpc, psk *[32]byte) (closer func() error)
server
func NewServer_ServiceRpc ¶
func NewServer_ServiceRpc(obj *ServiceRpc, psk *[32]byte) http.Handler
func ServiceStartSuccess ¶
func ServiceStartSuccess()
func SetClient_ServiceRpcConfig ¶
全局函数,请先设置客户端的地址,再获取全局客户端,此处不能并发调用
Types ¶
type Client_ServiceRpc ¶
type Client_ServiceRpc struct { RemoteUrl string // http://kmg.org:1234/ Psk *[32]byte }
func GetClient_ServiceRpc ¶
func GetClient_ServiceRpc() *Client_ServiceRpc
func NewClient_ServiceRpc ¶
func NewClient_ServiceRpc(RemoteUrl string, Psk *[32]byte) *Client_ServiceRpc
func (*Client_ServiceRpc) Send ¶
func (c *Client_ServiceRpc) Send(Status StartStatus) (Err error)
type Service ¶
type Service struct { Name string //Required WorkingDirectory string CommandLineSlice []string //Required 运行命令需要的slice数组.不要包含空格 }
这个是服务的定义数据结构,会序列化到具体实现的配置文件里面去
func (*Service) GetCommandLineBashString ¶
type ServiceRpc ¶
type ServiceRpc struct{}
func (*ServiceRpc) Send ¶
func (sr *ServiceRpc) Send(status StartStatus)
type StartStatus ¶
type StartStatus string
const ( StartStatusSuccess StartStatus = "StartStatusSuccess" StartStatusFail = "StartStatusFail" )
Click to show internal directories.
Click to hide internal directories.