forms

package
v0.0.0-...-f040671 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldTypeString

func FieldTypeString(f FieldType) string

func MakeFormFromStruct

func MakeFormFromStruct(p interface{}) (string, error)

Types

type Button

type Button Field

type Checkbox

type Checkbox Field

type Color

type Color Field

type Date

type Date Field

type DatetimeLocal

type DatetimeLocal Field

type Email

type Email Field

type EmailField

type EmailField Field

func (EmailField) Type

func (f EmailField) Type() FieldType

type Field

type Field struct {
	ID          string
	Name        string
	Kind        FieldType
	Value       string
	Label       string
	HelpText    string
	MinLen      int
	MaxLen      int
	Placeholder string
	ErrorMsg    string
	Required    bool
	Disabled    bool
}

func (Field) String

func (f Field) String() string

type FieldType

type FieldType int
const (
	TypeHidden FieldType = iota
	TypeText
	TypeEmail
	TypeInteger
)

type File

type File Field

type Form

type Form struct {
	Name       string
	Action     string
	Fields     []FormField
	SubmitText string
	HasCancel  bool
}

func MakeForm

func MakeForm(name, action, submitText string, hasCancel bool, fields ...FormField) *Form

func (*Form) String

func (f *Form) String() string

type FormField

type FormField interface {
	Type() FieldType
}

type Hidden

type Hidden Field

type Image

type Image Field

type IntegerField

type IntegerField Field

func (IntegerField) Type

func (f IntegerField) Type() FieldType

type Month

type Month Field

type Number

type Number Field

type Password

type Password Field

type Radio

type Radio Field

type Range

type Range Field

type Reset

type Reset Field
type Search Field

type Submit

type Submit Field

type Tel

type Tel Field

type Text

type Text Field

type TextField

type TextField Field

func (TextField) Type

func (f TextField) Type() FieldType

type Time

type Time Field

type Url

type Url Field

type Week

type Week Field

Jump to

Keyboard shortcuts

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