minor runtime fixes

This commit is contained in:
Asim Aslam 2020-01-17 14:14:47 +00:00
parent ee922a3da6
commit be788415ad
2 changed files with 8 additions and 1 deletions

View File

@ -155,7 +155,7 @@ func (r *runtime) Create(s *Service, opts ...CreateOption) error {
defer r.Unlock()
if _, ok := r.services[s.Name]; ok {
return errors.New("service already registered")
return errors.New("service already running")
}
var options CreateOptions

View File

@ -54,6 +54,13 @@ type ReadOptions struct {
Type string
}
// CreateType sets the type of service to create
func CreateType(t string) CreateOption {
return func(o *CreateOptions) {
o.Type = t
}
}
// WithCommand specifies the command to execute
func WithCommand(args ...string) CreateOption {
return func(o *CreateOptions) {