viewmodels

package
v0.0.0-...-ad95247 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ViewModelFor

func ViewModelFor[T ViewModel](req *http.Request, inst T, opts ...ViewModelOption) T

Types

type ErrorMessage

type ErrorMessage struct {
	Title string
	Body  string
}

type FileListViewModel

type FileListViewModel struct {
	ViewModelBase
	Files []domain.FileEntry
}

type LoginViewModel

type LoginViewModel struct {
	ViewModelBase
}

type RegisterViewModel

type RegisterViewModel struct {
	ViewModelBase
	InviteID  string
	InviteKey string
}

type ViewModel

type ViewModel interface {
	HasError() bool
	Error() *ErrorMessage

	RenderFull() bool

	WhiteBackground() bool
	CsrfToken() string
	// contains filtered or unexported methods
}

type ViewModelBase

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

func (*ViewModelBase) CsrfToken

func (v *ViewModelBase) CsrfToken() string

func (*ViewModelBase) Error

func (v *ViewModelBase) Error() *ErrorMessage

func (*ViewModelBase) HasError

func (v *ViewModelBase) HasError() bool

func (*ViewModelBase) RenderFull

func (v *ViewModelBase) RenderFull() bool

func (*ViewModelBase) WhiteBackground

func (v *ViewModelBase) WhiteBackground() bool

type ViewModelOption

type ViewModelOption func(inst ViewModel)

func WithError

func WithError(title, body string) ViewModelOption

Jump to

Keyboard shortcuts

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