zkt24/z2/backend/ent/runtime.go

36 lines
1.6 KiB
Go
Raw Normal View History

2024-04-25 11:51:47 +00:00
// Code generated by ent, DO NOT EDIT.
package ent
import (
"thesis/ent/key"
"thesis/ent/schema"
"thesis/ent/validators"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
keyFields := schema.Key{}.Fields()
_ = keyFields
// keyDescPublicKey is the schema descriptor for publicKey field.
keyDescPublicKey := keyFields[0].Descriptor()
// key.PublicKeyValidator is a validator for the "publicKey" field. It is called by the builders before save.
key.PublicKeyValidator = keyDescPublicKey.Validators[0].(func(string) error)
// keyDescOwner is the schema descriptor for Owner field.
keyDescOwner := keyFields[1].Descriptor()
// key.OwnerValidator is a validator for the "Owner" field. It is called by the builders before save.
key.OwnerValidator = keyDescOwner.Validators[0].(func(string) error)
// keyDescTrustScore is the schema descriptor for trustScore field.
keyDescTrustScore := keyFields[2].Descriptor()
// key.DefaultTrustScore holds the default value on creation for the trustScore field.
key.DefaultTrustScore = keyDescTrustScore.Default.(float64)
validatorsFields := schema.Validators{}.Fields()
_ = validatorsFields
// validatorsDescFacilitator is the schema descriptor for facilitator field.
validatorsDescFacilitator := validatorsFields[0].Descriptor()
// validators.FacilitatorValidator is a validator for the "facilitator" field. It is called by the builders before save.
validators.FacilitatorValidator = validatorsDescFacilitator.Validators[0].(func(string) error)
}