Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 42 for ParseDuration (0.32 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. 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)
  6. 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)
  7. internal/config/callhome/callhome.go

    		return cfg, err
    	}
    
    	cfg.Enable = env.Get(config.EnvMinIOCallhomeEnable,
    		kvs.GetWithDefault(Enable, DefaultKVS)) == config.EnableOn
    	cfg.Frequency, err = time.ParseDuration(env.Get(config.EnvMinIOCallhomeFrequency,
    		kvs.GetWithDefault(Frequency, DefaultKVS)))
    	return cfg, err
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  8. samples/jwt-server/src/main.go

    	// Add artificious delay based on delay query
    	delayParam := request.URL.Query().Get("delay")
    	if delayParam != "" {
    		delayDuration, err := time.ParseDuration(delayParam)
    		if err != nil {
    			// Handle invalid delay parameter
    			response.WriteHeader(http.StatusBadRequest)
    			response.Write([]byte("Invalid delay parameter"))
    			return
    		}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 16 23:56:50 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. src/cmd/trace/tasks.go

    			return !task.Complete()
    		})
    	}
    	if lat, err := time.ParseDuration(r.FormValue("latmin")); err == nil {
    		name = append(name, fmt.Sprintf("latency >= %s", lat))
    		conditions = append(conditions, func(t *parsedTrace, task *trace.UserTaskSummary) bool {
    			return task.Complete() && taskInterval(t, task).duration() >= lat
    		})
    	}
    	if lat, err := time.ParseDuration(r.FormValue("latmax")); err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  10. src/time/time_test.go

    }
    
    func TestParseDurationErrors(t *testing.T) {
    	for _, tc := range parseDurationErrorTests {
    		_, err := ParseDuration(tc.in)
    		if err == nil {
    			t.Errorf("ParseDuration(%q) = _, nil, want _, non-nil", tc.in)
    		} else if !strings.Contains(err.Error(), tc.expect) {
    			t.Errorf("ParseDuration(%q) = _, %q, error does not contain %q", tc.in, err, tc.expect)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top