forms

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolFormatter

func BoolFormatter(v reflect.Value) string

func IdFormatter

func IdFormatter(v reflect.Value) string

func IntFormatter

func IntFormatter(v reflect.Value) string

func StringFormatter

func StringFormatter(v reflect.Value) string

func StringSliceFormatter

func StringSliceFormatter(v reflect.Value) string

Types

type Component

type Component func(name, label, value string) *bolt.Field

type FieldConfig

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

func (*FieldConfig) Component

func (c *FieldConfig) Component(component Component)

func (*FieldConfig) Formatter

func (c *FieldConfig) Formatter(formatter Formatter)

func (*FieldConfig) Label

func (c *FieldConfig) Label(label string)

func (*FieldConfig) Name

func (c *FieldConfig) Name(name string)

type Formatter

type Formatter func(value reflect.Value) string

type Model

type Model struct {
	hound.Model `bson:",inline"`
	Theme       *Theme `json:"-" bson:"-"`
	// contains filtered or unexported fields
}

func NewModel

func NewModel(collectionName string, id ...string) Model

func (*Model) Element

func (m *Model) Element(name ...string) bolt.Element

func (*Model) Field

func (m *Model) Field(name string, obj any, theme ...*Theme) *bolt.Field

func (*Model) FieldConfig

func (m *Model) FieldConfig(name string) *FieldConfig
func (m *Model) UseComponent(fieldType string, component Component) {
	m.Theme[fieldType] = component
}

func (*Model) Form

func (m *Model) Form(s any, prefix string, theme ...*Theme) bolt.Element

type RenderMethod

type RenderMethod string
const (
	RenderByName      RenderMethod = "RenderByName"
	RenderByFieldType RenderMethod = "RenderByFieldType"
	RenderByDataType  RenderMethod = "RenderByDataType"
)

func (RenderMethod) String

func (m RenderMethod) String() string

Jump to

Keyboard shortcuts

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