/ ent / runtime.go
runtime.go
  1  // Code generated by ent, DO NOT EDIT.
  2  
  3  package ent
  4  
  5  import (
  6  	"time"
  7  
  8  	"github.com/google/uuid"
  9  	"github.com/mrusme/journalist/ent/feed"
 10  	"github.com/mrusme/journalist/ent/item"
 11  	"github.com/mrusme/journalist/ent/read"
 12  	"github.com/mrusme/journalist/ent/schema"
 13  	"github.com/mrusme/journalist/ent/subscription"
 14  	"github.com/mrusme/journalist/ent/token"
 15  	"github.com/mrusme/journalist/ent/user"
 16  )
 17  
 18  // The init function reads all schema descriptors with runtime code
 19  // (default values, validators, hooks and policies) and stitches it
 20  // to their package variables.
 21  func init() {
 22  	feedFields := schema.Feed{}.Fields()
 23  	_ = feedFields
 24  	// feedDescURL is the schema descriptor for url field.
 25  	feedDescURL := feedFields[1].Descriptor()
 26  	// feed.URLValidator is a validator for the "url" field. It is called by the builders before save.
 27  	feed.URLValidator = feedDescURL.Validators[0].(func(string) error)
 28  	// feedDescUsername is the schema descriptor for username field.
 29  	feedDescUsername := feedFields[2].Descriptor()
 30  	// feed.DefaultUsername holds the default value on creation for the username field.
 31  	feed.DefaultUsername = feedDescUsername.Default.(string)
 32  	// feedDescPassword is the schema descriptor for password field.
 33  	feedDescPassword := feedFields[3].Descriptor()
 34  	// feed.DefaultPassword holds the default value on creation for the password field.
 35  	feed.DefaultPassword = feedDescPassword.Default.(string)
 36  	// feedDescCreatedAt is the schema descriptor for created_at field.
 37  	feedDescCreatedAt := feedFields[18].Descriptor()
 38  	// feed.DefaultCreatedAt holds the default value on creation for the created_at field.
 39  	feed.DefaultCreatedAt = feedDescCreatedAt.Default.(func() time.Time)
 40  	// feedDescUpdatedAt is the schema descriptor for updated_at field.
 41  	feedDescUpdatedAt := feedFields[19].Descriptor()
 42  	// feed.DefaultUpdatedAt holds the default value on creation for the updated_at field.
 43  	feed.DefaultUpdatedAt = feedDescUpdatedAt.Default.(func() time.Time)
 44  	// feed.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
 45  	feed.UpdateDefaultUpdatedAt = feedDescUpdatedAt.UpdateDefault.(func() time.Time)
 46  	// feedDescID is the schema descriptor for id field.
 47  	feedDescID := feedFields[0].Descriptor()
 48  	// feed.DefaultID holds the default value on creation for the id field.
 49  	feed.DefaultID = feedDescID.Default.(func() uuid.UUID)
 50  	itemFields := schema.Item{}.Fields()
 51  	_ = itemFields
 52  	// itemDescItemLink is the schema descriptor for item_link field.
 53  	itemDescItemLink := itemFields[5].Descriptor()
 54  	// item.ItemLinkValidator is a validator for the "item_link" field. It is called by the builders before save.
 55  	item.ItemLinkValidator = itemDescItemLink.Validators[0].(func(string) error)
 56  	// itemDescCreatedAt is the schema descriptor for created_at field.
 57  	itemDescCreatedAt := itemFields[21].Descriptor()
 58  	// item.DefaultCreatedAt holds the default value on creation for the created_at field.
 59  	item.DefaultCreatedAt = itemDescCreatedAt.Default.(func() time.Time)
 60  	// itemDescUpdatedAt is the schema descriptor for updated_at field.
 61  	itemDescUpdatedAt := itemFields[22].Descriptor()
 62  	// item.DefaultUpdatedAt holds the default value on creation for the updated_at field.
 63  	item.DefaultUpdatedAt = itemDescUpdatedAt.Default.(func() time.Time)
 64  	// item.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
 65  	item.UpdateDefaultUpdatedAt = itemDescUpdatedAt.UpdateDefault.(func() time.Time)
 66  	// itemDescID is the schema descriptor for id field.
 67  	itemDescID := itemFields[0].Descriptor()
 68  	// item.DefaultID holds the default value on creation for the id field.
 69  	item.DefaultID = itemDescID.Default.(func() uuid.UUID)
 70  	readFields := schema.Read{}.Fields()
 71  	_ = readFields
 72  	// readDescCreatedAt is the schema descriptor for created_at field.
 73  	readDescCreatedAt := readFields[3].Descriptor()
 74  	// read.DefaultCreatedAt holds the default value on creation for the created_at field.
 75  	read.DefaultCreatedAt = readDescCreatedAt.Default.(func() time.Time)
 76  	// readDescID is the schema descriptor for id field.
 77  	readDescID := readFields[0].Descriptor()
 78  	// read.DefaultID holds the default value on creation for the id field.
 79  	read.DefaultID = readDescID.Default.(func() uuid.UUID)
 80  	subscriptionFields := schema.Subscription{}.Fields()
 81  	_ = subscriptionFields
 82  	// subscriptionDescName is the schema descriptor for name field.
 83  	subscriptionDescName := subscriptionFields[3].Descriptor()
 84  	// subscription.NameValidator is a validator for the "name" field. It is called by the builders before save.
 85  	subscription.NameValidator = subscriptionDescName.Validators[0].(func(string) error)
 86  	// subscriptionDescGroup is the schema descriptor for group field.
 87  	subscriptionDescGroup := subscriptionFields[4].Descriptor()
 88  	// subscription.GroupValidator is a validator for the "group" field. It is called by the builders before save.
 89  	subscription.GroupValidator = subscriptionDescGroup.Validators[0].(func(string) error)
 90  	// subscriptionDescCreatedAt is the schema descriptor for created_at field.
 91  	subscriptionDescCreatedAt := subscriptionFields[5].Descriptor()
 92  	// subscription.DefaultCreatedAt holds the default value on creation for the created_at field.
 93  	subscription.DefaultCreatedAt = subscriptionDescCreatedAt.Default.(func() time.Time)
 94  	// subscriptionDescID is the schema descriptor for id field.
 95  	subscriptionDescID := subscriptionFields[0].Descriptor()
 96  	// subscription.DefaultID holds the default value on creation for the id field.
 97  	subscription.DefaultID = subscriptionDescID.Default.(func() uuid.UUID)
 98  	tokenFields := schema.Token{}.Fields()
 99  	_ = tokenFields
100  	// tokenDescType is the schema descriptor for type field.
101  	tokenDescType := tokenFields[1].Descriptor()
102  	// token.DefaultType holds the default value on creation for the type field.
103  	token.DefaultType = tokenDescType.Default.(string)
104  	// token.TypeValidator is a validator for the "type" field. It is called by the builders before save.
105  	token.TypeValidator = tokenDescType.Validators[0].(func(string) error)
106  	// tokenDescName is the schema descriptor for name field.
107  	tokenDescName := tokenFields[2].Descriptor()
108  	// token.NameValidator is a validator for the "name" field. It is called by the builders before save.
109  	token.NameValidator = tokenDescName.Validators[0].(func(string) error)
110  	// tokenDescCreatedAt is the schema descriptor for created_at field.
111  	tokenDescCreatedAt := tokenFields[4].Descriptor()
112  	// token.DefaultCreatedAt holds the default value on creation for the created_at field.
113  	token.DefaultCreatedAt = tokenDescCreatedAt.Default.(func() time.Time)
114  	// tokenDescUpdatedAt is the schema descriptor for updated_at field.
115  	tokenDescUpdatedAt := tokenFields[5].Descriptor()
116  	// token.DefaultUpdatedAt holds the default value on creation for the updated_at field.
117  	token.DefaultUpdatedAt = tokenDescUpdatedAt.Default.(func() time.Time)
118  	// token.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
119  	token.UpdateDefaultUpdatedAt = tokenDescUpdatedAt.UpdateDefault.(func() time.Time)
120  	// tokenDescID is the schema descriptor for id field.
121  	tokenDescID := tokenFields[0].Descriptor()
122  	// token.DefaultID holds the default value on creation for the id field.
123  	token.DefaultID = tokenDescID.Default.(func() uuid.UUID)
124  	userFields := schema.User{}.Fields()
125  	_ = userFields
126  	// userDescUsername is the schema descriptor for username field.
127  	userDescUsername := userFields[1].Descriptor()
128  	// user.UsernameValidator is a validator for the "username" field. It is called by the builders before save.
129  	user.UsernameValidator = userDescUsername.Validators[0].(func(string) error)
130  	// userDescPassword is the schema descriptor for password field.
131  	userDescPassword := userFields[2].Descriptor()
132  	// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
133  	user.PasswordValidator = userDescPassword.Validators[0].(func(string) error)
134  	// userDescRole is the schema descriptor for role field.
135  	userDescRole := userFields[3].Descriptor()
136  	// user.DefaultRole holds the default value on creation for the role field.
137  	user.DefaultRole = userDescRole.Default.(string)
138  	// user.RoleValidator is a validator for the "role" field. It is called by the builders before save.
139  	user.RoleValidator = userDescRole.Validators[0].(func(string) error)
140  	// userDescCreatedAt is the schema descriptor for created_at field.
141  	userDescCreatedAt := userFields[4].Descriptor()
142  	// user.DefaultCreatedAt holds the default value on creation for the created_at field.
143  	user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
144  	// userDescUpdatedAt is the schema descriptor for updated_at field.
145  	userDescUpdatedAt := userFields[5].Descriptor()
146  	// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
147  	user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
148  	// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
149  	user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
150  	// userDescID is the schema descriptor for id field.
151  	userDescID := userFields[0].Descriptor()
152  	// user.DefaultID holds the default value on creation for the id field.
153  	user.DefaultID = userDescID.Default.(func() uuid.UUID)
154  }