diff --git a/runtime/default.go b/runtime/default.go index 740ceb7d..453510a3 100644 --- a/runtime/default.go +++ b/runtime/default.go @@ -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 diff --git a/runtime/options.go b/runtime/options.go index 02bc99e8..5c2ce688 100644 --- a/runtime/options.go +++ b/runtime/options.go @@ -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) {