mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: add type for type edges (#318)
Will be used for adding methods on the struct edges
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -23,12 +23,7 @@ type {{ $.Name }} struct {
|
||||
{{- with $.Edges }}
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the {{ $.Name }}Query when eager-loading is set.
|
||||
Edges struct {
|
||||
{{- range $e := $.Edges }}
|
||||
// {{ $e.StructField }} holds the value of the {{ $e.Name }} edge.
|
||||
{{ $e.StructField }} {{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }} {{ with $e.StructTag }}`{{ . }}`{{ end }}
|
||||
{{- end }}
|
||||
} `json:"edges"`
|
||||
Edges {{ $.Name }}Edges `json:"edges"`
|
||||
{{- end -}}
|
||||
{{- /* Additional fields to add by the storage driver. */}}
|
||||
{{- $tmpl := printf "dialect/%s/model/fields" $.Storage }}
|
||||
@@ -39,6 +34,16 @@ type {{ $.Name }} struct {
|
||||
{{ template "model/fields/additional" $ }}
|
||||
}
|
||||
|
||||
{{- with $.Edges }}
|
||||
// {{ $.Name }}Edges holds the relations/edges for other nodes in the graph.
|
||||
type {{ $.Name }}Edges struct {
|
||||
{{- range $e := . }}
|
||||
// {{ $e.StructField }} holds the value of the {{ $e.Name }} edge.
|
||||
{{ $e.StructField }} {{ if not $e.Unique }}[]{{ end }}*{{ $e.Type.Name }} {{ with $e.StructTag }}`{{ . }}`{{ end }}
|
||||
{{- end }}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
{{ $tmpl = printf "dialect/%s/decode/one" $.Storage }}
|
||||
{{ xtemplate $tmpl $ }}
|
||||
|
||||
|
||||
@@ -21,10 +21,13 @@ type Group struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
} `json:"edges"`
|
||||
Edges GroupEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// GroupEdges holds the relations/edges for other nodes in the graph.
|
||||
type GroupEdges struct {
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
@@ -21,17 +21,20 @@ type User struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
parent_id *int
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*User) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -31,18 +31,21 @@ type Card struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the CardQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Spec holds the value of the spec edge.
|
||||
Spec []*Spec
|
||||
} `json:"edges"`
|
||||
Edges CardEdges `json:"edges"`
|
||||
owner_id *string
|
||||
|
||||
// StaticField defined by templates.
|
||||
StaticField string `json:"boring,omitempty"`
|
||||
}
|
||||
|
||||
// CardEdges holds the relations/edges for other nodes in the graph.
|
||||
type CardEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Spec holds the value of the spec edge.
|
||||
Spec []*Spec
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Card) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -30,17 +30,20 @@ type File struct {
|
||||
Group string `json:"group,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the FileQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Type holds the value of the type edge.
|
||||
Type *FileType
|
||||
} `json:"edges"`
|
||||
Edges FileEdges `json:"edges"`
|
||||
type_id *string
|
||||
group_file_id *string
|
||||
owner_id *string
|
||||
}
|
||||
|
||||
// FileEdges holds the relations/edges for other nodes in the graph.
|
||||
type FileEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Type holds the value of the type edge.
|
||||
Type *FileType
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*File) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -24,10 +24,13 @@ type FileType struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the FileTypeQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
} `json:"edges"`
|
||||
Edges FileTypeEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// FileTypeEdges holds the relations/edges for other nodes in the graph.
|
||||
type FileTypeEdges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
@@ -33,19 +33,22 @@ type Group struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Blocked holds the value of the blocked edge.
|
||||
Blocked []*User
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
// Info holds the value of the info edge.
|
||||
Info *GroupInfo
|
||||
} `json:"edges"`
|
||||
Edges GroupEdges `json:"edges"`
|
||||
info_id *string
|
||||
}
|
||||
|
||||
// GroupEdges holds the relations/edges for other nodes in the graph.
|
||||
type GroupEdges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Blocked holds the value of the blocked edge.
|
||||
Blocked []*User
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
// Info holds the value of the info edge.
|
||||
Info *GroupInfo
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Group) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -26,10 +26,13 @@ type GroupInfo struct {
|
||||
MaxUsers int `json:"max_users,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupInfoQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
} `json:"edges"`
|
||||
Edges GroupInfoEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// GroupInfoEdges holds the relations/edges for other nodes in the graph.
|
||||
type GroupInfoEdges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
@@ -24,15 +24,18 @@ type Node struct {
|
||||
Value int `json:"value,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the NodeQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Prev holds the value of the prev edge.
|
||||
Prev *Node `gqlgen:prev`
|
||||
// Next holds the value of the next edge.
|
||||
Next *Node `gqlgen:next`
|
||||
} `json:"edges"`
|
||||
Edges NodeEdges `json:"edges"`
|
||||
prev_id *string
|
||||
}
|
||||
|
||||
// NodeEdges holds the relations/edges for other nodes in the graph.
|
||||
type NodeEdges struct {
|
||||
// Prev holds the value of the prev edge.
|
||||
Prev *Node `gqlgen:prev`
|
||||
// Next holds the value of the next edge.
|
||||
Next *Node `gqlgen:next`
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Node) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -24,16 +24,19 @@ type Pet struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the PetQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Team holds the value of the team edge.
|
||||
Team *User
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
} `json:"edges"`
|
||||
Edges PetEdges `json:"edges"`
|
||||
owner_id *string
|
||||
team_id *string
|
||||
}
|
||||
|
||||
// PetEdges holds the relations/edges for other nodes in the graph.
|
||||
type PetEdges struct {
|
||||
// Team holds the value of the team edge.
|
||||
Team *User
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Pet) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -22,10 +22,13 @@ type Spec struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the SpecQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card []*Card
|
||||
} `json:"edges"`
|
||||
Edges SpecEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// SpecEdges holds the relations/edges for other nodes in the graph.
|
||||
type SpecEdges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card []*Card
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
@@ -38,35 +38,38 @@ type User struct {
|
||||
Role user.Role `json:"role,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card *Card
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
// Team holds the value of the team edge.
|
||||
Team *Pet
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
group_blocked_id *string
|
||||
user_spouse_id *string
|
||||
parent_id *string
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card *Card
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
// Team holds the value of the team edge.
|
||||
Team *Pet
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*User) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -30,17 +30,20 @@ type Card struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the CardQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Spec holds the value of the spec edge.
|
||||
Spec []*Spec
|
||||
} `json:"edges"`
|
||||
Edges CardEdges `json:"edges"`
|
||||
|
||||
// StaticField defined by templates.
|
||||
StaticField string `json:"boring,omitempty"`
|
||||
}
|
||||
|
||||
// CardEdges holds the relations/edges for other nodes in the graph.
|
||||
type CardEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Spec holds the value of the spec edge.
|
||||
Spec []*Spec
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into Card.
|
||||
func (c *Card) FromResponse(res *gremlin.Response) error {
|
||||
vmap, err := res.ReadValueMap()
|
||||
|
||||
@@ -29,12 +29,15 @@ type File struct {
|
||||
Group string `json:"group,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the FileQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Type holds the value of the type edge.
|
||||
Type *FileType
|
||||
} `json:"edges"`
|
||||
Edges FileEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// FileEdges holds the relations/edges for other nodes in the graph.
|
||||
type FileEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
// Type holds the value of the type edge.
|
||||
Type *FileType
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into File.
|
||||
|
||||
@@ -23,10 +23,13 @@ type FileType struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the FileTypeQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
} `json:"edges"`
|
||||
Edges FileTypeEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// FileTypeEdges holds the relations/edges for other nodes in the graph.
|
||||
type FileTypeEdges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into FileType.
|
||||
|
||||
@@ -32,16 +32,19 @@ type Group struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Blocked holds the value of the blocked edge.
|
||||
Blocked []*User
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
// Info holds the value of the info edge.
|
||||
Info *GroupInfo
|
||||
} `json:"edges"`
|
||||
Edges GroupEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// GroupEdges holds the relations/edges for other nodes in the graph.
|
||||
type GroupEdges struct {
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Blocked holds the value of the blocked edge.
|
||||
Blocked []*User
|
||||
// Users holds the value of the users edge.
|
||||
Users []*User
|
||||
// Info holds the value of the info edge.
|
||||
Info *GroupInfo
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into Group.
|
||||
|
||||
@@ -25,10 +25,13 @@ type GroupInfo struct {
|
||||
MaxUsers int `json:"max_users,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the GroupInfoQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
} `json:"edges"`
|
||||
Edges GroupInfoEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// GroupInfoEdges holds the relations/edges for other nodes in the graph.
|
||||
type GroupInfoEdges struct {
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into GroupInfo.
|
||||
|
||||
@@ -23,12 +23,15 @@ type Node struct {
|
||||
Value int `json:"value,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the NodeQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Prev holds the value of the prev edge.
|
||||
Prev *Node `gqlgen:prev`
|
||||
// Next holds the value of the next edge.
|
||||
Next *Node `gqlgen:next`
|
||||
} `json:"edges"`
|
||||
Edges NodeEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// NodeEdges holds the relations/edges for other nodes in the graph.
|
||||
type NodeEdges struct {
|
||||
// Prev holds the value of the prev edge.
|
||||
Prev *Node `gqlgen:prev`
|
||||
// Next holds the value of the next edge.
|
||||
Next *Node `gqlgen:next`
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into Node.
|
||||
|
||||
@@ -23,12 +23,15 @@ type Pet struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the PetQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Team holds the value of the team edge.
|
||||
Team *User
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
} `json:"edges"`
|
||||
Edges PetEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// PetEdges holds the relations/edges for other nodes in the graph.
|
||||
type PetEdges struct {
|
||||
// Team holds the value of the team edge.
|
||||
Team *User
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into Pet.
|
||||
|
||||
@@ -21,10 +21,13 @@ type Spec struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the SpecQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card []*Card
|
||||
} `json:"edges"`
|
||||
Edges SpecEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// SpecEdges holds the relations/edges for other nodes in the graph.
|
||||
type SpecEdges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card []*Card
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into Spec.
|
||||
|
||||
@@ -38,30 +38,33 @@ type User struct {
|
||||
Role user.Role `json:"role,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card *Card
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
// Team holds the value of the team edge.
|
||||
Team *Pet
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Card holds the value of the card edge.
|
||||
Card *Card
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Files holds the value of the files edge.
|
||||
Files []*File
|
||||
// Groups holds the value of the groups edge.
|
||||
Groups []*Group
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
// Team holds the value of the team edge.
|
||||
Team *Pet
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
}
|
||||
|
||||
// FromResponse scans the gremlin response data into User.
|
||||
|
||||
@@ -23,17 +23,20 @@ type User struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
user_spouse_id *uint64
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Followers holds the value of the followers edge.
|
||||
Followers []*User
|
||||
// Following holds the value of the following edge.
|
||||
Following []*User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*User) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -21,13 +21,16 @@ type Car struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the CarQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
} `json:"edges"`
|
||||
Edges CarEdges `json:"edges"`
|
||||
owner_id *int
|
||||
}
|
||||
|
||||
// CarEdges holds the relations/edges for other nodes in the graph.
|
||||
type CarEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Car) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -35,20 +35,23 @@ type User struct {
|
||||
State user.State `json:"state,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Car holds the value of the car edge.
|
||||
Car *Car
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
parent_id *int
|
||||
user_spouse_id *int
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Parent holds the value of the parent edge.
|
||||
Parent *User
|
||||
// Children holds the value of the children edge.
|
||||
Children []*User
|
||||
// Spouse holds the value of the spouse edge.
|
||||
Spouse *User
|
||||
// Car holds the value of the car edge.
|
||||
Car *Car
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*User) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -21,13 +21,16 @@ type Car struct {
|
||||
ID int `json:"id,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the CarQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
} `json:"edges"`
|
||||
Edges CarEdges `json:"edges"`
|
||||
owner_id *int
|
||||
}
|
||||
|
||||
// CarEdges holds the relations/edges for other nodes in the graph.
|
||||
type CarEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Car) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -39,10 +39,13 @@ type User struct {
|
||||
State user.State `json:"state,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Car holds the value of the car edge.
|
||||
Car []*Car
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Car holds the value of the car edge.
|
||||
Car []*Car
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
@@ -26,13 +26,16 @@ type Pet struct {
|
||||
LicensedAt *time.Time `json:"licensed_at,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the PetQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
} `json:"edges"`
|
||||
Edges PetEdges `json:"edges"`
|
||||
owner_id *int
|
||||
}
|
||||
|
||||
// PetEdges holds the relations/edges for other nodes in the graph.
|
||||
type PetEdges struct {
|
||||
// Owner holds the value of the owner edge.
|
||||
Owner *User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Pet) scanValues() []interface{} {
|
||||
return []interface{}{
|
||||
|
||||
@@ -23,12 +23,15 @@ type User struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Edges holds the relations/edges for other nodes in the graph.
|
||||
// The values are being populated by the UserQuery when eager-loading is set.
|
||||
Edges struct {
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
} `json:"edges"`
|
||||
Edges UserEdges `json:"edges"`
|
||||
}
|
||||
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// Pets holds the value of the pets edge.
|
||||
Pets []*Pet
|
||||
// Friends holds the value of the friends edge.
|
||||
Friends []*User
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
|
||||
Reference in New Issue
Block a user