Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for Embedded (0.25 sec)

  1. tests/embedded_struct_test.go

    		Name  string
    		Email string
    	}
    
    	type HNPost struct {
    		BasePost
    		Author  `gorm:"EmbeddedPrefix:user_"` // Embedded struct
    		Upvotes int32
    	}
    
    	type EngadgetPost struct {
    		BasePost BasePost `gorm:"Embedded"`
    		Author   *Author  `gorm:"Embedded;EmbeddedPrefix:author_"` // Embedded struct
    		ImageUrl string
    	}
    
    	DB.Migrator().DropTable(&HNPost{}, &EngadgetPost{})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  2. schema/schema_test.go

    		{Name: "Name", DBName: "company_name", BindNames: []string{"Base", "Name"}, DataType: schema.String, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    		{Name: "Ignored", BindNames: []string{"Base", "Ignored"}, TagSettings: map[string]string{"-": "-", "EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  3. internal/grid/grid_types_msgp_test.go

    					z.Embedded.Num, err = dc.ReadInt()
    					if err != nil {
    						err = msgp.WrapError(err, "Embedded", "Num")
    						return
    					}
    				case "String":
    					z.Embedded.String, err = dc.ReadString()
    					if err != nil {
    						err = msgp.WrapError(err, "Embedded", "String")
    						return
    					}
    				default:
    					err = dc.Skip()
    					if err != nil {
    						err = msgp.WrapError(err, "Embedded")
    						return
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 8.1K bytes
    - Viewed (0)
  4. schema/schema.go

    	if field, ok := schema.FieldsByName[name]; ok {
    		return field
    	}
    	return nil
    }
    
    // LookUpFieldByBindName looks for the closest field in the embedded struct.
    //
    //	type Struct struct {
    //		Embedded struct {
    //			ID string // is selected by LookUpFieldByBindName([]string{"Embedded", "ID"}, "ID")
    //		}
    //		ID string // is selected by LookUpFieldByBindName([]string{"ID"}, "ID")
    //	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  5. src/cmd/api/testdata/src/pkg/p1/p1.go

    type common struct {
    	i int
    }
    
    type TPtrUnexported struct {
    	*common
    }
    
    type TPtrExported struct {
    	*Embedded
    }
    
    type FuncType func(x, y int, s string) (b *B, err error)
    
    type Embedded struct{}
    
    func PlainFunc(x, y int, s string) (b *B, err error)
    
    func (*Embedded) OnEmbedded() {}
    
    func (*T) JustOnT()             {}
    func (*B) JustOnB()             {}
    func (*common) OnBothTandBPtr() {}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Dec 02 16:29:41 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  6. callbacks/preload.go

    				if relation.Schema == s {
    					setPreloadMap(relation.Name, value, args)
    				}
    			}
    
    			for embedded, embeddedRelations := range s.Relationships.EmbeddedRelations {
    				for _, value := range embeddedValues(embeddedRelations) {
    					setPreloadMap(embedded, value, args)
    				}
    			}
    		} else {
    			setPreloadMap(preloadFields[0], value, args)
    		}
    	}
    	return preloadMap
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  7. internal/grid/grid_types_test.go

    //go:generate msgp -unexported -file=$GOFILE -tests=false -o=grid_types_msgp_test.go
    
    type testRequest struct {
    	Num    int
    	String string
    }
    
    type testResponse struct {
    	OrgNum    int
    	OrgString string
    	Embedded  testRequest
    }
    
    func newTestRequest() *testRequest {
    	return &testRequest{}
    }
    
    func newTestResponse() *testResponse {
    	return &testResponse{}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  8. schema/relationship.go

    func (schema *Schema) setRelation(relation *Relationship) {
    	// set non-embedded relation
    	if rel := schema.Relationships.Relations[relation.Name]; rel != nil {
    		if len(rel.Field.BindNames) > 1 {
    			schema.Relationships.Relations[relation.Name] = relation
    		}
    	} else {
    		schema.Relationships.Relations[relation.Name] = relation
    	}
    
    	// set embedded relation
    	if len(relation.Field.EmbeddedBindNames) <= 1 {
    		return
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  9. schema/field.go

    				field.Creatable = false
    			}
    
    			if !strings.Contains(v, "update") {
    				field.Updatable = false
    			}
    		}
    	}
    
    	// Normal anonymous field or having `EMBEDDED` tag
    	if _, ok := field.TagSettings["EMBEDDED"]; ok || (field.GORMDataType != Time && field.GORMDataType != Bytes && !isValuer &&
    		fieldStruct.Anonymous && (field.Creatable || field.Updatable || field.Readable)) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  10. src/cmd/api/main_test.go

    	list := make([]string, n)
    	for i := range list {
    		list[i] = typ.Method(i).Name()
    	}
    	sort.Strings(list)
    	return list
    }
    
    // sortedEmbeddeds returns constraint types embedded in an
    // interface. It does not include embedded interface types or methods.
    func (w *Walker) sortedEmbeddeds(typ *types.Interface) []string {
    	n := typ.NumEmbeddeds()
    	list := make([]string, 0, n)
    	for i := 0; i < n; i++ {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
Back to top