Add common function to create a service.
This commit is contained in:
+9
-1
@@ -1,7 +1,15 @@
|
||||
// Package service provides a simple way to create a system service.
|
||||
// Currently only supprts Windows.
|
||||
// Currently only supports Windows.
|
||||
package service
|
||||
|
||||
// Creates a new service. name is the internal name
|
||||
// and should not contain spaces. Display name is the pretty print
|
||||
// name. The description is an arbitrary string used to describe the
|
||||
// service.
|
||||
func NewService(name, displayName, description string) Service {
|
||||
return newService(name, displayName, description)
|
||||
}
|
||||
|
||||
// Represents a generic way to interact with the system's service.
|
||||
type Service interface {
|
||||
// Installs this service on the system. May return an
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func NewService(name, displayName, description string) Service {
|
||||
func newService(name, displayName, description string) Service {
|
||||
return &windowsService{
|
||||
name: name,
|
||||
displayName: displayName,
|
||||
|
||||
Reference in New Issue
Block a user