Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 139 for nowFunc (0.33 sec)

  1. soft_delete.go

    }
    
    func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause) {
    }
    
    func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *Statement) {
    	if stmt.SQL.Len() == 0 && !stmt.Statement.Unscoped {
    		curTime := stmt.DB.NowFunc()
    		stmt.AddClause(clause.Set{{Column: clause.Column{Name: sd.Field.DBName}, Value: curTime}})
    		stmt.SetColumn(sd.Field.DBName, curTime, true)
    
    		if stmt.Schema != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Feb 01 06:40:55 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/envelope.go

    	// key ID related error codes for metrics
    	errKeyIDOKCode      ErrCodeKeyID = "ok"
    	errKeyIDEmptyCode   ErrCodeKeyID = "empty"
    	errKeyIDTooLongCode ErrCodeKeyID = "too_long"
    )
    
    // NowFunc is exported so tests can override it.
    var NowFunc = time.Now
    
    type StateFunc func() (State, error)
    type ErrCodeKeyID string
    
    type State struct {
    	Transformer value.Transformer
    
    	EncryptedObject kmstypes.EncryptedObject
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 00:23:50 UTC 2023
    - 18.7K bytes
    - Viewed (0)
  3. pkg/kubelet/nodestatus/setters_test.go

    				"Diff: %s", cmp.Diff(expectNode, node))
    		})
    	}
    
    }
    
    func TestReadyCondition(t *testing.T) {
    	now := time.Now()
    	before := now.Add(-time.Second)
    	nowFunc := func() time.Time { return now }
    
    	withCapacity := &v1.Node{
    		Status: v1.NodeStatus{
    			Capacity: v1.ResourceList{
    				v1.ResourceCPU:              *resource.NewMilliQuantity(2000, resource.DecimalSI),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 21:47:24 UTC 2024
    - 76.1K bytes
    - Viewed (0)
  4. pkg/registry/core/persistentvolume/storage/storage_test.go

    	hostPathType := new(api.HostPathType)
    	*hostPathType = api.HostPathType(pathType)
    	return hostPathType
    }
    
    func validNewPersistentVolume(name string) *api.PersistentVolume {
    	now := persistentvolume.NowFunc()
    	pv := &api.PersistentVolume{
    		ObjectMeta: metav1.ObjectMeta{
    			Name: name,
    		},
    		Spec: api.PersistentVolumeSpec{
    			Capacity: api.ResourceList{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  5. src/database/sql/sql.go

    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname drivers
    var drivers = make(map[string]driver.Driver)
    
    // nowFunc returns the current time; it's overridden in tests.
    var nowFunc = time.Now
    
    // Register makes a database driver available by the provided name.
    // If Register is called twice with the same name or if driver is nil,
    // it panics.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
  6. callbacks/create.go

    				}
    			}
    			return called
    		})
    	}
    }
    
    // ConvertToCreateValues convert to create values
    func ConvertToCreateValues(stmt *gorm.Statement) (values clause.Values) {
    	curTime := stmt.DB.NowFunc()
    
    	switch value := stmt.Dest.(type) {
    	case map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, value)
    	case *map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, *value)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  7. src/database/sql/sql_test.go

    		t.Errorf("stats.OpenConnections = %d; want 0", got)
    	}
    }
    
    func TestConnMaxLifetime(t *testing.T) {
    	t0 := time.Unix(1000000, 0)
    	offset := time.Duration(0)
    
    	nowFunc = func() time.Time { return t0.Add(offset) }
    	defer func() { nowFunc = time.Now }()
    
    	db := newTestDB(t, "magicquery")
    	defer closeDB(t, db)
    
    	driver := db.Driver().(*fakeDriver)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config_test.go

    	}
    }
    
    func Test_kmsv2PluginProbe_rotateDEKOnKeyIDChange(t *testing.T) {
    	defaultUseSeed := GetKDF()
    
    	origNowFunc := envelopekmsv2.NowFunc
    	now := origNowFunc() // freeze time
    	t.Cleanup(func() { envelopekmsv2.NowFunc = origNowFunc })
    	envelopekmsv2.NowFunc = func() time.Time { return now }
    
    	klog.LogToStderr(false)
    	var level klog.Level
    	if err := level.Set("6"); err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 16:56:39 UTC 2024
    - 72.3K bytes
    - Viewed (0)
  9. tests/create_test.go

    }
    
    func TestCreateWithNowFuncOverride(t *testing.T) {
    	user := User{Name: "CreateUserTimestampOverride"}
    	curTime := now.MustParse("2016-01-01")
    
    	NEW := DB.Session(&gorm.Session{
    		NowFunc: func() time.Time {
    			return curTime
    		},
    	})
    
    	NEW.Save(&user)
    
    	AssertEqual(t, user.CreatedAt, curTime)
    	AssertEqual(t, user.UpdatedAt, curTime)
    
    	var newUser User
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go

    	// we start the timer before we make the network call because kmsv2PluginWriteDEKSourceMaxTTL is meant to be the upper bound
    	expirationTimestamp := envelopekmsv2.NowFunc().Add(kmsv2PluginWriteDEKSourceMaxTTL)
    
    	// dynamically check if we want to use KDF seed to derive DEKs or just a single DEK
    	// this gate can only change during tests, but the check is cheap enough to always make
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 16:56:39 UTC 2024
    - 41.2K bytes
    - Viewed (0)
Back to top