frm

package module
v0.0.0-...-bb2c92d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 2 Imported by: 3

README

forms

Build Status Go Report Card

Go form structure

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetFields func(uint8) []Field

GetFields defines a function signature to retrieve a form's fields, instead of passing function definitions, pointers or interfaces between packages. BuildIt.ninja can generate this code when using the Forms feature. GetFields is used by session.

Functions

func GetForms

func GetForms(id uint8, ids ...uint8) (f map[uint8]Form)

GetForms retrieves forms by their ids. The duplicate ids parameter is to ensure at least one uint8 is passed to the function without adding additional checks (same as Go's built-in exec.Command()).

Types

type Field

type Field struct {
	Name, Err, Placeholder   string
	Options                  []Option
	Max, Min                 interface{}
	MaxLen, MinLen           int
	Step                     float32
	Regex                    *regexp.Regexp
	V8                       func(*Field, ...string)
	Value                    interface{}
	Required, Disable, Focus bool
}

Field represents attributes for each HTML form field.

func (*Field) Bytes

func (f *Field) Bytes() (o []byte)

Bytes returns f.Value as a byte slice.

func (*Field) Checked

func (f *Field) Checked() (o bool)

Checked returns f.Value as a boolean.

func (*Field) Float32

func (f *Field) Float32() (o float32)

Float32 returns f.Value as a float32.

func (*Field) Float64

func (f *Field) Float64() (o float64)

Float64 returns f.Value as a float64.

func (*Field) Str

func (f *Field) Str() (o string)

Str returns f.Value as a string.

func (*Field) Strs

func (f *Field) Strs() (o []string)

Strs returns f.Value as a string slice.

func (*Field) Time

func (f *Field) Time() (o time.Time)

Time returns f.Value as a datetime.

func (*Field) Uint

func (f *Field) Uint() (o uint)

Uint returns f.Value as an unsigned integer.

func (*Field) Uint8

func (f *Field) Uint8() (o uint8)

Uint8 returns f.Value as an unsigned integer.

func (*Field) Uint8s

func (f *Field) Uint8s() (o []uint8)

Uint8s returns f.Value as an unsigned integer slice.

func (*Field) Uint16

func (f *Field) Uint16() (o uint16)

Uint16 returns f.Value as an unsigned integer.

func (*Field) Uint16s

func (f *Field) Uint16s() (o []uint16)

Uint16s returns f.Value as an unsigned integer slice.

func (*Field) Uint32

func (f *Field) Uint32() (o uint32)

Uint32 returns f.Value as an unsigned integer.

func (*Field) Uint32s

func (f *Field) Uint32s() (o []uint32)

Uint32s returns f.Value as an unsigned integer slice.

func (*Field) Uint64

func (f *Field) Uint64() (o uint64)

Uint64 returns f.Value as an unsigned integer.

func (*Field) Uint64s

func (f *Field) Uint64s() (o []uint64)

Uint64s returns f.Value as an unsigned integer slice.

func (*Field) Uints

func (f *Field) Uints() (o []uint)

Uints returns f.Value as an unsigned integer slice.

type Form

type Form struct {
	Action uint8
	Fields []Field
	Err    error
}

Form represents details about a HTML form.

type Option

type Option struct {
	Label, Value string
	Selected     bool
}

Option represents attributes for an option within a select box, list box or data list.

Jump to

Keyboard shortcuts

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