brochure

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAdmin

func RegisterAdmin(app *framework.App) error

RegisterAdmin registers Brochure on the runtime admin with fields derived from the model: pdf is a file field and cover an image field, with their upload policies from the storage tags.

Types

type Brochure

type Brochure struct {
	ID        uint         `gorm:"primaryKey" json:"id"`
	Title     string       `gorm:"size:255;not null" json:"title"`
	PDF       types.File   `gorm:"size:512;not null;uniqueIndex" json:"pdf" storage:"prefix=brochures/pdf/;max_bytes=5242880;types=application/pdf"`
	Cover     *types.Image `gorm:"size:512;uniqueIndex" json:"cover" storage:"prefix=brochures/cover/;max_bytes=1048576"`
	CreatedAt time.Time    `json:"created_at"`
	UpdatedAt time.Time    `json:"updated_at"`
}

Brochure has storage-backed fields: a required PDF and an optional cover image. Each column holds the object key under the prefix its field owns (the storage tag); the admin uploads to it, previews the image, and deletes the replaced or removed file after the change commits (through storage/claims, whose table main migrates).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL