Implemented Epic 1 core kernel and infrastructure stories: Story 1.1: Enhanced DI Container - Added providers for database, health, metrics, and error bus - Extended CoreModule to include all core services Story 1.2: Database Layer with Ent ORM - Created Ent schema for User, Role, Permission, AuditLog entities - Implemented many-to-many relationships (User-Role, Role-Permission) - Created database client wrapper with connection pooling - Added database provider to DI container with migration support Story 1.3: Health Monitoring and Metrics System - Implemented health check registry and interface - Added database health checker - Created Prometheus metrics system with HTTP instrumentation - Added health and metrics providers to DI container Story 1.4: Error Handling and Error Bus - Implemented channel-based error bus - Created ErrorPublisher interface - Added error bus provider with lifecycle management Story 1.5: HTTP Server Foundation - Created HTTP server with Gin framework - Implemented comprehensive middleware stack: - Request ID generation - Structured logging - Panic recovery with error bus integration - Prometheus metrics collection - CORS support - Registered core routes: /healthz, /ready, /metrics - Integrated with FX lifecycle for graceful shutdown All components are integrated via DI container and ready for use.
74 lines
4.1 KiB
Go
74 lines
4.1 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.dcentral.systems/toolz/goplt/internal/ent/auditlog"
|
|
"git.dcentral.systems/toolz/goplt/internal/ent/permission"
|
|
"git.dcentral.systems/toolz/goplt/internal/ent/role"
|
|
"git.dcentral.systems/toolz/goplt/internal/ent/schema"
|
|
"git.dcentral.systems/toolz/goplt/internal/ent/user"
|
|
)
|
|
|
|
// 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() {
|
|
auditlogFields := schema.AuditLog{}.Fields()
|
|
_ = auditlogFields
|
|
// auditlogDescActorID is the schema descriptor for actor_id field.
|
|
auditlogDescActorID := auditlogFields[1].Descriptor()
|
|
// auditlog.ActorIDValidator is a validator for the "actor_id" field. It is called by the builders before save.
|
|
auditlog.ActorIDValidator = auditlogDescActorID.Validators[0].(func(string) error)
|
|
// auditlogDescAction is the schema descriptor for action field.
|
|
auditlogDescAction := auditlogFields[2].Descriptor()
|
|
// auditlog.ActionValidator is a validator for the "action" field. It is called by the builders before save.
|
|
auditlog.ActionValidator = auditlogDescAction.Validators[0].(func(string) error)
|
|
// auditlogDescTimestamp is the schema descriptor for timestamp field.
|
|
auditlogDescTimestamp := auditlogFields[5].Descriptor()
|
|
// auditlog.DefaultTimestamp holds the default value on creation for the timestamp field.
|
|
auditlog.DefaultTimestamp = auditlogDescTimestamp.Default.(func() time.Time)
|
|
permissionFields := schema.Permission{}.Fields()
|
|
_ = permissionFields
|
|
// permissionDescName is the schema descriptor for name field.
|
|
permissionDescName := permissionFields[1].Descriptor()
|
|
// permission.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
permission.NameValidator = permissionDescName.Validators[0].(func(string) error)
|
|
roleFields := schema.Role{}.Fields()
|
|
_ = roleFields
|
|
// roleDescName is the schema descriptor for name field.
|
|
roleDescName := roleFields[1].Descriptor()
|
|
// role.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
role.NameValidator = roleDescName.Validators[0].(func(string) error)
|
|
// roleDescCreatedAt is the schema descriptor for created_at field.
|
|
roleDescCreatedAt := roleFields[3].Descriptor()
|
|
// role.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
role.DefaultCreatedAt = roleDescCreatedAt.Default.(func() time.Time)
|
|
userFields := schema.User{}.Fields()
|
|
_ = userFields
|
|
// userDescEmail is the schema descriptor for email field.
|
|
userDescEmail := userFields[1].Descriptor()
|
|
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
|
|
// userDescPasswordHash is the schema descriptor for password_hash field.
|
|
userDescPasswordHash := userFields[2].Descriptor()
|
|
// user.PasswordHashValidator is a validator for the "password_hash" field. It is called by the builders before save.
|
|
user.PasswordHashValidator = userDescPasswordHash.Validators[0].(func(string) error)
|
|
// userDescVerified is the schema descriptor for verified field.
|
|
userDescVerified := userFields[3].Descriptor()
|
|
// user.DefaultVerified holds the default value on creation for the verified field.
|
|
user.DefaultVerified = userDescVerified.Default.(bool)
|
|
// userDescCreatedAt is the schema descriptor for created_at field.
|
|
userDescCreatedAt := userFields[4].Descriptor()
|
|
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
|
|
// userDescUpdatedAt is the schema descriptor for updated_at field.
|
|
userDescUpdatedAt := userFields[5].Descriptor()
|
|
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
|
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
|
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
|
|
}
|