code: func stringToReadableDurationFunc() mapstructure.DecodeHookFunc {
  	return func(
  		f reflect.Type,
  		t reflect.Type,
  		data interface{}) (interface{}, error) {
  		var v api.ReadableDuration
  		if t != reflect.TypeOf(v) {
  			return data, nil
  		}
  
  		switch {
  		case f.Kind() == reflect.String:
  			if dur, err := time.ParseDuration(data.(string)); err != nil {
  				return nil, err
  			} else {
  				v = api.ReadableDuration(dur)
  			}
  			return v, nil
  		default:
  			return data, nil
  		}
  	}
  }
docs: // stringToReadableDurationFunc is a mapstructure hook for decoding a string
  // into an api.ReadableDuration for backwards compatibility.