Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 77 for hasAny (0.32 sec)

  1. internal/grid/manager.go

    		return ErrUnknownHandler
    	}
    	s := strings.Join(subroute, "/")
    	if debugPrint {
    		fmt.Println("RegisterSingleHandler: ", id.String(), "subroute:", s)
    	}
    
    	if len(subroute) == 0 {
    		if m.handlers.hasAny(id) && !id.isTestHandler() {
    			return fmt.Errorf("handler %v: %w", id.String(), ErrHandlerAlreadyExists)
    		}
    
    		m.handlers.single[id] = h
    		return nil
    	}
    	subID := makeSubHandlerID(id, s)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  2. internal/grid/handlers.go

    func (h *handlers) init() {
    	h.subSingle = make(map[subHandlerID]SingleHandlerFn)
    	h.subStateless = make(map[subHandlerID]*StatelessHandler)
    	h.subStreams = make(map[subHandlerID]*StreamHandler)
    }
    
    func (h *handlers) hasAny(id HandlerID) bool {
    	if !id.valid() {
    		return false
    	}
    	return h.single[id] != nil || h.stateless[id] != nil || h.streams[id] != nil
    }
    
    func (h *handlers) hasSubhandler(id subHandlerID) bool {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.9K bytes
    - Viewed (0)
  3. schema/relationship_test.go

    		UserRefer uint
    	}
    
    	type User struct {
    		gorm.Model
    		Profile Profile `gorm:"ForeignKey:UserRefer"`
    	}
    
    	checkStructRelation(t, &User{}, Relation{
    		Name: "Profile", Type: schema.HasOne, Schema: "User", FieldSchema: "Profile",
    		References: []Reference{{"ID", "User", "UserRefer", "Profile", "", true}},
    	})
    }
    
    func TestHasOneOverrideReferences(t *testing.T) {
    	type Profile struct {
    		gorm.Model
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  4. schema/relationship.go

    		case reflect.Struct:
    			relation.Type = HasOne
    		case reflect.Slice:
    			relation.Type = HasMany
    		}
    	}
    
    	if schema.err == nil {
    		schema.setRelation(relation)
    		switch relation.Type {
    		case HasOne:
    			schema.Relationships.HasOne = append(schema.Relationships.HasOne, relation)
    		case HasMany:
    			schema.Relationships.HasMany = append(schema.Relationships.HasMany, relation)
    		case BelongsTo:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  5. association.go

    			}
    			if association.Unscope && oldBelongsToExpr != nil {
    				association.Error = association.DB.Model(nil).Where(oldBelongsToExpr).Delete(reflect.New(rel.FieldSchema.ModelType).Interface()).Error
    			}
    		case schema.HasOne, schema.HasMany:
    			var (
    				primaryFields []*schema.Field
    				foreignKeys   []string
    				updateMap     = map[string]interface{}{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  6. schema/schema_test.go

    	relations := []Relation{
    		{
    			Name: "Account", Type: schema.HasOne, Schema: "User", FieldSchema: "Account",
    			References: []Reference{{"ID", "User", "UserID", "Account", "", true}},
    		},
    		{
    			Name: "Pets", Type: schema.HasMany, Schema: "User", FieldSchema: "Pet",
    			References: []Reference{{"ID", "User", "UserID", "Pet", "", true}},
    		},
    		{
    			Name: "Toys", Type: schema.HasMany, Schema: "User", FieldSchema: "Toy",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  7. callbacks/delete.go

    			if !v {
    				continue
    			}
    
    			rel, ok := db.Statement.Schema.Relationships.Relations[column]
    			if !ok {
    				continue
    			}
    
    			switch rel.Type {
    			case schema.HasOne, schema.HasMany:
    				queryConds := rel.ToQueryConditions(db.Statement.Context, db.Statement.ReflectValue)
    				modelValue := reflect.New(rel.FieldSchema.ModelType).Interface()
    				tx := db.Session(&gorm.Session{NewDB: true}).Model(modelValue)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  8. tests/associations_has_many_test.go

    	}
    
    	AssertAssociationCount(t, user2, "Team", 0, "after clear")
    }
    
    func TestHasManyAssociationForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-hasmany-1", Config{Pets: 2}),
    		*GetUser("slice-hasmany-2", Config{Pets: 0}),
    		*GetUser("slice-hasmany-3", Config{Pets: 4}),
    	}
    
    	DB.Create(&users)
    
    	// Count
    	AssertAssociationCount(t, users, "Pets", 6, "")
    
    	// Find
    	var pets []Pet
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  9. manifests/charts/gateway/templates/_helpers.tpl

    {{- if not (or (eq $key "app") (eq $key "istio")) }} {{ $key | quote }}: {{ $val | quote }} {{- end }} {{- end }} {{- end }} {{- define "gateway.selectorLabels" -}} {{- if hasKey .Values.labels "app" }} {{- with .Values.labels.app }}app: {{.|quote}} {{- end}} {{- else }}app: {{ include "gateway.name" . }} {{- end }} {{- if hasKey .Values.labels "istio" }} {{- with .Values.labels.istio }} istio: {{.|quote}} {{- end}} {{- else }} istio: {{ include "gateway.name" . | trimPrefix "istio-" }} {{- end }}...
    Others
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Mon Mar 06 16:57:46 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  10. manifests/charts/istiod-remote/templates/istiod-injector-configmap.yaml

        templates:
    {{- if not (hasKey .Values.sidecarInjectorWebhook.templates "sidecar") }}
          sidecar: |
    {{ .Files.Get "files/injection-template.yaml" | trim | indent 8 }}
    {{- end }}
    {{- if not (hasKey .Values.sidecarInjectorWebhook.templates "gateway") }}
          gateway: |
    {{ .Files.Get "files/gateway-injection-template.yaml" | trim | indent 8 }}
    {{- end }}
    Others
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Wed Feb 21 03:10:21 GMT 2024
    - 3.4K bytes
    - Viewed (0)
Back to top