28 lines
507 B
Go
28 lines
507 B
Go
|
package configs
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
type SystemService struct {
|
||
|
Name string `json:"Name"`
|
||
|
Enabled bool `json:"Enabled"`
|
||
|
}
|
||
|
|
||
|
func (sys *SystemService) Manage() error {
|
||
|
if sys.Enabled {
|
||
|
fmt.Printf("Processing Daemon %s", sys.Name)
|
||
|
} else {
|
||
|
fmt.Printf("Nothing to do for daemone %s\n", sys.Name)
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (sys *SystemService) Start() error {
|
||
|
fmt.Printf("Starting %s\n", sys.Name)
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (sys *SystemService) Stop() error {
|
||
|
fmt.Printf("Stoping %s\n", sys.Name)
|
||
|
return nil
|
||
|
}
|