forms

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseForm

type BaseForm struct {
	Fields          []form.Field
	ValidationFuncs []form.ValidationFunc
}

func (*BaseForm) AddField

func (b *BaseForm) AddField(name string, field form.Field) error

func (*BaseForm) GetField

func (b *BaseForm) GetField(name string) (form.Field, bool)

func (*BaseForm) GetFields

func (b *BaseForm) GetFields() []form.Field

func (*BaseForm) GetValidationFunctions

func (b *BaseForm) GetValidationFunctions() []form.ValidationFunc

func (*BaseForm) RegisterInitialValues

func (b *BaseForm) RegisterInitialValues(values map[string]interface{}) error

RegisterInitialValues TODO make it return an error if there are values in the map that do not match any field

func (*BaseForm) RegisterValidationFunctions

func (b *BaseForm) RegisterValidationFunctions(validationFuncs ...form.ValidationFunc)

func (*BaseForm) Save

func (b *BaseForm) Save(values map[string]form.HTMLType) (interface{}, error)

Jump to

Keyboard shortcuts

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