Add common function to create a service.

This commit is contained in:
Daniel Theophanes
2012-05-10 23:27:08 -07:00
parent e5ca8cfda8
commit fdbffbf5d9
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -1,7 +1,15 @@
// Package service provides a simple way to create a system service. // Package service provides a simple way to create a system service.
// Currently only supprts Windows. // Currently only supports Windows.
package service 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. // Represents a generic way to interact with the system's service.
type Service interface { type Service interface {
// Installs this service on the system. May return an // Installs this service on the system. May return an
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"unsafe" "unsafe"
) )
func NewService(name, displayName, description string) Service { func newService(name, displayName, description string) Service {
return &windowsService{ return &windowsService{
name: name, name: name,
displayName: displayName, displayName: displayName,