examples: add ent init --template example

This commit is contained in:
Ariel Mashraki
2022-08-11 16:17:53 +03:00
committed by Ariel Mashraki
parent 0066eb986d
commit 24d1fad3b8

View File

@@ -0,0 +1,25 @@
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/mixin"
)
// {{ . }} holds the schema definition for the {{ . }} entity.
type {{ . }} struct {
ent.Schema
}
// Mixins of the {{ . }}.
func ({{ . }}) Mixins() []ent.Mixin {
return []ent.Mixin{
mixin.Time{},
}
}
// Fields of the {{ . }}.
func ({{ . }}) Fields() []ent.Field {
return []ent.Field{
// Fields go here.
}
}