res

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const InertiaBuildPath = "/public/build/"
View Source
const InertiaManifestPath = "./public/build/manifest.json"
View Source
const InertiaRootTemplatePath = "resources/views/root.html"
View Source
const ViteHotPath = "./public/hot"

Variables

This section is empty.

Functions

func NewInertia

func NewInertia(rootTemplatePath string, opts ...gonertia.Option) *gonertia.Inertia

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, tmpl string, data *TemplateData) error

func Vite

func Vite(manifestPath, buildDir string) func(path string) (string, error)

Types

type AlertMessage

type AlertMessage struct {
	Type string // success, error, warning, info, debug
	Body string
}

type InertiaFlashProvider

type InertiaFlashProvider struct {
	// contains filtered or unexported fields
}

func NewInertiaFlashProvider

func NewInertiaFlashProvider() *InertiaFlashProvider

func (*InertiaFlashProvider) FlashErrors

func (p *InertiaFlashProvider) FlashErrors(ctx context.Context, errors gonertia.ValidationErrors) error

func (*InertiaFlashProvider) GetErrors

type TemplateData

type TemplateData struct {
	StringMap        map[string]string
	IntMap           map[string]int
	FloatMap         map[string]float64
	BoolMap          map[string]bool
	FuncMap          template.FuncMap
	Data             map[string]any
	ValidationErrors shared.ValidationErrors
	Messages         []*AlertMessage
}

Jump to

Keyboard shortcuts

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