Documentation
¶
Overview ¶
Code generated by gombit make resource. DO NOT EDIT.
Code generated by gombit make resource. DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdmin ¶
RegisterAdmin registers Task on the runtime admin. Feature packages own this call — the framework never discovers GORM models by itself (ADR-013).
Register requires cookie auth; it returns an error under Bearer-only mode.
Types ¶
type Hooks ¶ added in v0.2.0
type Hooks struct{}
Hooks implements TaskHooks. This file is generated once and is yours to edit: set server-managed columns (tenant, owner, timestamps not handled by GORM, …) on row in BeforeCreate. Regeneration does not overwrite it.
type Task ¶
type Task struct {
ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time
UpdatedAt time.Time
Title string `gorm:"size:255;not null"`
Done bool
}
Task is the tutorial's feature-package GORM model — the human-owned source of truth, exactly as `gombit make resource Task title:string:required done:bool` scaffolds it (model-first: no "do not edit" banner). The request/response DTOs and CRUD handler are derived from it into the committed dto.gen.go / handler.gen.go, which TestGeneratedFilesAreFresh re-derives and byte-compares so this model and its generated files never drift. It has no soft-delete DeletedAt: Gombit deletes rows physically (ADR-019).
type TaskHooks ¶ added in v0.2.0
type TaskHooks interface {
BeforeCreate(ctx context.Context, row *Task, body taskCreateBody) error
}
TaskHooks are the customization points for the generated Task handler. The generated handler owns the invariant CRUD sequence and calls these; set server-managed columns (tenant, owner, …) in BeforeCreate rather than editing generated plumbing.