code: func RegisterType(name string, retries uint, handler HandlerFunc) (*Type, error) {
  	// Make sure name is unique
  	if _, found := Types[name]; found {
  		return Types[name], newErrorNameAlreadyRegistered(name)
  	}
  	// Make sure handler is a function
  	handlerType := reflect.TypeOf(handler)
  	if handlerType.Kind() != reflect.Func {
  		return nil, fmt.Errorf("jobs: in RegisterNewType, handler must be a function. Got %T", handler)
  	}
  	if handlerType.NumIn() > 1 {
  		return nil, fmt.Errorf("jobs: in RegisterNewType, handler must accept 0 or 1 arguments. Got %d.", handlerType.NumIn())
  	}
  	if handlerType.NumOut() != 1 {
  		return nil, fmt.Errorf("jobs: in RegisterNewType, handler must have exactly one return value. Got %d.", handlerType.NumOut())
  	}
  	if !typeIsError(handlerType.Out(0)) {
  		return nil, fmt.Errorf("jobs: in RegisterNewType, handler must return an error. Got return value of type %s.", handlerType.Out(0).String())
  	}
  	Type := &Type{
  		name:    name,
  		handler: handler,
  		retries: retries,
  	}
  	if handlerType.NumIn() == 1 {
  		Type.dataType = handlerType.In(0)
  	}
  	Types[name] = Type
  	return Type, nil
  }
docs: // RegisterType registers a new type of job that can be executed by workers.
  // name should be a unique string identifier for the job.
  // retries is the number of times this type of job should be retried if it fails.
  // handler is a function that a worker will call in order to execute the job.
  // handler should be a function which accepts either 0 or 1 arguments of any type,
  // corresponding to the data for a job of this type. All jobs of this type must have
  // data with the same type as the first argument to handler, or nil if the handler
  // accepts no arguments.