forms

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 14, 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 CheckboxField

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

}

func EmailField

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

func HiddenField

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

func HiddenIdField

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

func IdFormatter

func IdFormatter(v reflect.Value) string

func IntFormatter

func IntFormatter(v reflect.Value) string

func NumberField

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

func PhoneField

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

func RadioField

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

func SelectField

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

func StringFormatter

func StringFormatter(v reflect.Value) string

func StringSliceFormatter

func StringSliceFormatter(v reflect.Value) string

func TextField

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

func TextareaField

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

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 FieldTypes

type FieldTypes string
const (
	IdFieldType       FieldTypes = "Id"
	TextFieldType     FieldTypes = "Text"
	HiddenFieldType   FieldTypes = "Hidden"
	CheckboxFieldType FieldTypes = "Checkbox"
	NumberFieldType   FieldTypes = "Number"
	EmailFieldType    FieldTypes = "Email"
	PhoneFieldType    FieldTypes = "Phone"
	// TagsFieldType     FieldTypes = "Tags"
	RadioFieldType    FieldTypes = "Radio"
	TextareaFieldType FieldTypes = "Textarea"
	SelectFieldType   FieldTypes = "Select"
)

func (FieldTypes) String

func (t FieldTypes) String() string

type Formatter

type Formatter func(value reflect.Value) string

type Model

type Model struct {
	hound.Model `bson:",inline"`
	// 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) *bolt.Field

func (*Model) FieldConfig

func (m *Model) FieldConfig(name string) *FieldConfig

func (*Model) Form

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

func (*Model) UseComponent

func (m *Model) UseComponent(fieldType string, component Component)

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