brochure

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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