inits/cmd/dkl-system-init/simple-service.go
2018-07-06 19:07:37 +11:00

24 lines
315 B
Go

package main
type Oneshot struct {
Name string
Needs []string
Func func() error
}
func (s Oneshot) GetName() string {
return s.Name
}
func (s Oneshot) CanStart() bool {
return services.HasFlag(s.Needs...)
}
func (s Oneshot) Run(_ func()) error {
return s.Func()
}
func (s Oneshot) Stop() {
// no-op
}