// NewService creates a Service according to the given key.
// If nil is passed, the Service will be created with the default serviceRuntime.
NewService creates a Service according to the given key.
If nil is passed, the Service will be created with the default serviceRuntime.
// NewService creates a Service according to the given key . // If nil is passed the Service will be created with the default serviceRuntime .
func NewService(serviceKey string, runtime serviceRuntime) (Service, error) {
	if runtime == nil {
		runtime = &defaultServiceRuntime{}
	}
	svc, ok := getServices(runtime)[serviceKey]
	if !ok {
		return nil, fmt.Errorf(
			"invalid program service, want one in {%s}, got '%s'",
			strings.Join(GetServices(), ", "),
			serviceKey,
		)
	}
	return svc, nil
}
func NewService ( serviceKey string , runtime serviceRuntime ) ( Service , error ) { if runtime == nil { runtime = & defaultServiceRuntime { } } svc , ok := getServices ( runtime ) [ serviceKey ] if ! ok { return nil , fmt . Errorf ( " " , strings . Join ( GetServices ( ) , " " ) , serviceKey , ) } return svc , nil }
NewService creates a Service according to the given key.
NewService creates a Service according to the given key .