Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 64 for ParseDuration (0.23 sec)

  1. internal/config/api/api.go

    		return cfg, errors.New("invalid API max requests value")
    	}
    
    	requestsDeadline, err := time.ParseDuration(env.Get(EnvAPIRequestsDeadline, kvs.GetWithDefault(apiRequestsDeadline, DefaultKVS)))
    	if err != nil {
    		return cfg, err
    	}
    	cfg.RequestsDeadline = requestsDeadline
    
    	clusterDeadline, err := time.ParseDuration(env.Get(EnvAPIClusterDeadline, kvs.GetWithDefault(apiClusterDeadline, DefaultKVS)))
    	if err != nil {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  2. src/time/example_test.go

    	// d.Truncate( 10m0s) = 1h10m0s
    	// d.Truncate(1h0m0s) = 1h0m0s
    }
    
    func ExampleParseDuration() {
    	hours, _ := time.ParseDuration("10h")
    	complex, _ := time.ParseDuration("1h10m10s")
    	micro, _ := time.ParseDuration("1µs")
    	// The package also accepts the incorrect but common prefix u for micro.
    	micro2, _ := time.ParseDuration("1us")
    
    	fmt.Println(hours)
    	fmt.Println(complex)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 13 01:05:00 UTC 2024
    - 22.4K bytes
    - Viewed (0)
  3. internal/config/batch/batch.go

    	cfg.ExpirationWorkersWait = 0
    
    	rduration, err := time.ParseDuration(env.Get(EnvReplicationWorkersWait, kvs.GetWithDefault(ReplicationWorkersWait, DefaultKVS)))
    	if err != nil {
    		return cfg, err
    	}
    	if rduration < 0 {
    		return cfg, config.ErrInvalidBatchReplicationWorkersWait(nil)
    	}
    
    	kduration, err := time.ParseDuration(env.Get(EnvKeyRotationWorkersWait, kvs.GetWithDefault(KeyRotationWorkersWait, DefaultKVS)))
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  4. internal/config/drive/drive.go

    	d := env.Get(EnvMaxDriveTimeout, env.Get(EnvMaxDriveTimeoutLegacy, env.Get(EnvMaxDiskTimeoutLegacy, kvs.GetWithDefault(MaxTimeout, DefaultKVS))))
    	if d == "" {
    		cfg.MaxTimeout = 30 * time.Second
    	} else {
    		dur, _ := time.ParseDuration(d)
    		if dur < time.Second {
    			cfg.MaxTimeout = 30 * time.Second
    		} else {
    			cfg.MaxTimeout = getMaxTimeout(dur)
    		}
    	}
    	return cfg, err
    }
    
    func getMaxTimeout(t time.Duration) time.Duration {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 3K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/cache/CacheBuilderSpec.java

          spec.recordStats = true;
        }
      }
    
      /** Base class for parsing times with durations */
      abstract static class DurationParser implements ValueParser {
        protected abstract void parseDuration(CacheBuilderSpec spec, long duration, TimeUnit unit);
    
        @Override
        public void parse(CacheBuilderSpec spec, String key, @CheckForNull String value) {
          if (isNullOrEmpty(value)) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Aug 22 14:27:44 UTC 2022
    - 18.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/cache/CacheBuilderSpec.java

          spec.recordStats = true;
        }
      }
    
      /** Base class for parsing times with durations */
      abstract static class DurationParser implements ValueParser {
        protected abstract void parseDuration(CacheBuilderSpec spec, long duration, TimeUnit unit);
    
        @Override
        public void parse(CacheBuilderSpec spec, String key, @CheckForNull String value) {
          if (isNullOrEmpty(value)) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Aug 22 14:27:44 UTC 2022
    - 18.1K bytes
    - Viewed (0)
  7. security/pkg/pki/ca/fuzz_test.go

    		if err != nil {
    			return
    		}
    
    		// create cert options
    		certOpts := CertOpts{}
    		err = ff.GenerateStruct(&certOpts)
    		if err != nil {
    			return
    		}
    		TTL, err := time.ParseDuration("800ms")
    		if err != nil {
    			return
    		}
    		certOpts.TTL = TTL
    
    		// call target
    		ca.Sign(csrPEM, certOpts)
    	})
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Oct 12 14:51:41 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  8. internal/config/scanner/scanner.go

    		maxWait = env.Get(EnvMaxWait, kvs.GetWithDefault(MaxWait, DefaultKVS))
    	}
    	cfg.MaxWait, err = time.ParseDuration(maxWait)
    	if err != nil {
    		return err
    	}
    	cycle := env.Get(EnvCycle, kvs.GetWithDefault(Cycle, DefaultKVS))
    	if cycle == "" {
    		cycle = "1m"
    	}
    	cfg.Cycle, err = time.ParseDuration(cycle)
    	if err != nil {
    		return err
    	}
    	return nil
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  9. pilot/pkg/networking/core/listener_builder.go

    		ConfigType: &listener.Filter_TypedConfig{TypedConfig: protoconv.MessageToAny(tcpProxy)},
    	})
    
    	return filterStack
    }
    
    func parseDuration(s string) *durationpb.Duration {
    	if s == "" {
    		return nil
    	}
    	t, err := time.ParseDuration(s)
    	if err != nil {
    		return nil
    	}
    	return durationpb.New(t)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon May 06 04:44:06 UTC 2024
    - 17.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go

    // UnmarshalJSON implements the json.Unmarshaller interface.
    func (d *Duration) UnmarshalJSON(b []byte) error {
    	var str string
    	err := json.Unmarshal(b, &str)
    	if err != nil {
    		return err
    	}
    
    	pd, err := time.ParseDuration(str)
    	if err != nil {
    		return err
    	}
    	d.Duration = pd
    	return nil
    }
    
    // MarshalJSON implements the json.Marshaler interface.
    func (d Duration) MarshalJSON() ([]byte, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Feb 08 00:11:06 UTC 2020
    - 1.9K bytes
    - Viewed (0)
Back to top