Initial setup of an admin page that dynamically reflects the DB to create the CRUD stuff.

This commit is contained in:
Zed A. Shaw 2025-07-13 12:28:03 -04:00
parent 02910b8b93
commit 859e3ad0e3
6 changed files with 46 additions and 3 deletions

View file

@ -1,5 +1,7 @@
package data
import "reflect"
type Login struct {
Username string `db:"username" validate:"required,max=30"`
Password string `db:"password" validate:"required,max=128"`
@ -23,3 +25,11 @@ type Stream struct {
Title string `db:"title" json:"title"`
Description string `db:"description" json:"description"`
}
func Models() map[string]reflect.Type {
return map[string]reflect.Type{
"stream": reflect.TypeFor[Stream](),
"stream_link": reflect.TypeFor[Link](),
"user": reflect.TypeFor[User](),
}
}