Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for valberg (0.18 sec)

  1. tests/scanner_valuer_test.go

    	}
    
    	if err := DB.Create(&data).Error; err != nil {
    		t.Fatalf("No error should happened when create scanner valuer struct, but got %v", err)
    	}
    
    	var result ScannerValuerStruct
    
    	if err := DB.Find(&result, "id = ?", data.ID).Error; err != nil {
    		t.Fatalf("no error should happen when query scanner, valuer struct, but got %v", err)
    	}
    
    	if result.ExampleStructPtr.Val != "value2" {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  2. utils/tests/utils.go

    			t.Errorf("%v: expect: %+v, got %+v", utils.FileWithLineNum(), expect, got)
    			return
    		}
    
    		if valuer, ok := got.(driver.Valuer); ok {
    			got, _ = valuer.Value()
    		}
    
    		if valuer, ok := expect.(driver.Valuer); ok {
    			expect, _ = valuer.Value()
    		}
    
    		if got != nil {
    			got = reflect.Indirect(reflect.ValueOf(got)).Interface()
    		}
    
    		if expect != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  3. cni/pkg/plugin/sidecar_redirect.go

    			"excludeIPCidrs", isFound, valErr)
    	}
    	isFound, redir.excludeInboundPorts, valErr = getAnnotationOrDefault("excludeInboundPorts", pi.Annotations)
    	if valErr != nil {
    		return nil, fmt.Errorf("annotation value error for value %s; annotationFound = %t: %v",
    			"excludeInboundPorts", isFound, valErr)
    	}
    	isFound, redir.includeInboundPorts, valErr = getAnnotationOrDefault("includeInboundPorts", pi.Annotations)
    	if valErr != nil {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  4. schema/field_test.go

    				CreatedAt: time.Now(),
    				UpdatedAt: time.Now(),
    				DeletedAt: gorm.DeletedAt{Time: time.Now(), Valid: true},
    			},
    			Name:     "valuer_and_setter",
    			Age:      18,
    			Birthday: tests.Now(),
    			Active:   true,
    		}
    		reflectValue = reflect.ValueOf(&user)
    	)
    
    	// test valuer
    	values := map[string]interface{}{
    		"name":       user.Name,
    		"id":         user.ID,
    		"created_at": user.CreatedAt,
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  5. utils/utils.go

    	yval := reflect.ValueOf(y)
    	if xval.Kind() == reflect.Ptr && xval.IsNil() ||
    		yval.Kind() == reflect.Ptr && yval.IsNil() {
    		return false
    	}
    
    	if valuer, ok := x.(driver.Valuer); ok {
    		x, _ = valuer.Value()
    	}
    	if valuer, ok := y.(driver.Valuer); ok {
    		y, _ = valuer.Value()
    	}
    	return reflect.DeepEqual(x, y)
    }
    
    func ToString(value interface{}) string {
    	switch v := value.(type) {
    	case string:
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  6. interfaces.go

    	Commit() error
    	Rollback() error
    }
    
    // Tx sql.Tx interface
    type Tx interface {
    	ConnPool
    	TxCommitter
    	StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt
    }
    
    // Valuer gorm valuer interface
    type Valuer interface {
    	GormValue(context.Context, *DB) clause.Expr
    }
    
    // GetDBConnector SQL db connector
    type GetDBConnector interface {
    	GetDBConn() (*sql.DB, error)
    }
    
    // Rows rows interface
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. internal/cachevalue/cache.go

    		// There is a new value, release lock and return it.
    		v = t.valErr.Load()
    		t.updating.Unlock()
    		return v.v, v.e
    	}
    	t.update()
    	v = t.valErr.Load()
    	t.updating.Unlock()
    	return v.v, v.e
    }
    
    func (t *Cache[T]) update() {
    	val, err := t.updateFn()
    	if err != nil {
    		if t.opts.ReturnLastGood {
    			// Keep last good value.
    			v := t.valErr.Load()
    			if v != nil {
    				val = v.v
    			}
    		}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  8. schema/field.go

    	}
    
    	fieldValue := reflect.New(field.IndirectFieldType)
    	// if field is valuer, used its value or first field as data type
    	valuer, isValuer := fieldValue.Interface().(driver.Valuer)
    	if isValuer {
    		if _, ok := fieldValue.Interface().(GormDataTypeInterface); !ok {
    			if v, err := valuer.Value(); reflect.ValueOf(v).IsValid() && err == nil {
    				fieldValue = reflect.ValueOf(v)
    			}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  9. clause/expression.go

    	builder.WriteQuoted(like.Column)
    	builder.WriteString(" NOT LIKE ")
    	builder.AddVar(builder, like.Value)
    }
    
    func eqNil(value interface{}) bool {
    	if valuer, ok := value.(driver.Valuer); ok && !eqNilReflect(valuer) {
    		value, _ = valuer.Value()
    	}
    
    	return value == nil || eqNilReflect(value)
    }
    
    func eqNilReflect(value interface{}) bool {
    	reflectValue := reflect.ValueOf(value)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  10. logger/sql.go

    		default:
    			rv := reflect.ValueOf(v)
    			if v == nil || !rv.IsValid() || rv.Kind() == reflect.Ptr && rv.IsNil() {
    				vars[idx] = nullStr
    			} else if valuer, ok := v.(driver.Valuer); ok {
    				v, _ = valuer.Value()
    				convertParams(v, idx)
    			} else if rv.Kind() == reflect.Ptr && !rv.IsZero() {
    				convertParams(reflect.Indirect(rv).Interface(), idx)
    			} else if isNumeric(rv.Kind()) {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
Back to top