fields

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseField

type BaseField struct {
	Name                  string
	Label                 string
	ValidationFuncs       []form.FieldValidationFunc
	InitialValue          interface{}
	SupersedingAttributes map[string]*string
}

func (*BaseField) GetLabel

func (f *BaseField) GetLabel() string

func (*BaseField) GetName

func (f *BaseField) GetName() string

func (*BaseField) GetValidationFunctions

func (f *BaseField) GetValidationFunctions() []form.FieldValidationFunc

func (*BaseField) RegisterInitialValue

func (f *BaseField) RegisterInitialValue(value interface{})

func (*BaseField) RegisterLabel

func (f *BaseField) RegisterLabel(label string) error

func (*BaseField) RegisterName

func (f *BaseField) RegisterName(name string) error

func (*BaseField) RegisterValidationFunctions

func (f *BaseField) RegisterValidationFunctions(validationFuncs ...form.FieldValidationFunc)

func (*BaseField) SetSupersedingAttribute

func (f *BaseField) SetSupersedingAttribute(name string, value *string)

type BooleanField

type BooleanField struct {
	BaseField
	Required bool
}

func (*BooleanField) GetValidationFunctions

func (f *BooleanField) GetValidationFunctions() []form.FieldValidationFunc

func (*BooleanField) GoTypeToHTMLType

func (f *BooleanField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*BooleanField) HTML

func (f *BooleanField) HTML() (string, error)

func (*BooleanField) HTMLTypeToGoType

func (f *BooleanField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type Choice

type Choice struct {
	Value string
	Label string
}

type ChoiceField

type ChoiceField struct {
	BaseField
	Choices     []Choice
	Required    bool
	Placeholder *string
}

func (*ChoiceField) GetValidationFunctions

func (f *ChoiceField) GetValidationFunctions() []form.FieldValidationFunc

func (*ChoiceField) GoTypeToHTMLType

func (f *ChoiceField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*ChoiceField) HTML

func (f *ChoiceField) HTML() (string, error)

func (*ChoiceField) HTMLTypeToGoType

func (f *ChoiceField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type DateField

type DateField struct {
	BaseField
	Required    bool
	MinDate     *time.Time
	MaxDate     *time.Time
	Placeholder *string
}

func (*DateField) GetValidationFunctions

func (f *DateField) GetValidationFunctions() []form.FieldValidationFunc

func (*DateField) GoTypeToHTMLType

func (f *DateField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*DateField) HTML

func (f *DateField) HTML() (string, error)

func (*DateField) HTMLTypeToGoType

func (f *DateField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type EmailField

type EmailField struct {
	BaseField
	Required bool
}

func (*EmailField) GetValidationFunctions

func (f *EmailField) GetValidationFunctions() []form.FieldValidationFunc

func (*EmailField) GoTypeToHTMLType

func (f *EmailField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*EmailField) HTML

func (f *EmailField) HTML() (string, error)

func (*EmailField) HTMLTypeToGoType

func (f *EmailField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type FloatField

type FloatField struct {
	BaseField
	MinValue *float64
	MaxValue *float64
	Required bool
}

func (*FloatField) GetValidationFunctions

func (f *FloatField) GetValidationFunctions() []form.FieldValidationFunc

func (*FloatField) GoTypeToHTMLType

func (f *FloatField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*FloatField) HTML

func (f *FloatField) HTML() (string, error)

func (*FloatField) HTMLTypeToGoType

func (f *FloatField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type IntegerField

type IntegerField struct {
	BaseField
	MinValue *int
	MaxValue *int
	Required bool
}

func (*IntegerField) GetValidationFunctions

func (f *IntegerField) GetValidationFunctions() []form.FieldValidationFunc

func (*IntegerField) GoTypeToHTMLType

func (f *IntegerField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*IntegerField) HTML

func (f *IntegerField) HTML() (string, error)

func (*IntegerField) HTMLTypeToGoType

func (f *IntegerField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type MultipleChoiceField

type MultipleChoiceField struct {
	BaseField
	Choices     []Choice
	Required    bool
	Placeholder *string
}

func (*MultipleChoiceField) GetValidationFunctions

func (f *MultipleChoiceField) GetValidationFunctions() []form.FieldValidationFunc

func (*MultipleChoiceField) GoTypeToHTMLType

func (f *MultipleChoiceField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*MultipleChoiceField) HTML

func (f *MultipleChoiceField) HTML() (string, error)

func (*MultipleChoiceField) HTMLTypeToGoType

func (f *MultipleChoiceField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type TextField

type TextField struct {
	BaseField
	Placeholder *string
	MaxLength   *uint
	MinLength   *uint
	Required    bool
	Regex       *string
}

func (*TextField) GetValidationFunctions

func (f *TextField) GetValidationFunctions() []form.FieldValidationFunc

func (*TextField) GoTypeToHTMLType

func (f *TextField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*TextField) HTML

func (f *TextField) HTML() (string, error)

func (*TextField) HTMLTypeToGoType

func (f *TextField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type URLField

type URLField struct {
	BaseField
	Required bool
}

func (*URLField) GetValidationFunctions

func (f *URLField) GetValidationFunctions() []form.FieldValidationFunc

func (*URLField) GoTypeToHTMLType

func (f *URLField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*URLField) HTML

func (f *URLField) HTML() (string, error)

func (*URLField) HTMLTypeToGoType

func (f *URLField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

type UUIDField added in v0.0.2

type UUIDField struct {
	BaseField
	Required bool
}

func (*UUIDField) GetValidationFunctions added in v0.0.2

func (f *UUIDField) GetValidationFunctions() []form.FieldValidationFunc

func (*UUIDField) GoTypeToHTMLType added in v0.0.2

func (f *UUIDField) GoTypeToHTMLType(value interface{}) (form.HTMLType, error)

func (*UUIDField) HTML added in v0.0.2

func (f *UUIDField) HTML() (string, error)

func (*UUIDField) HTMLTypeToGoType added in v0.0.2

func (f *UUIDField) HTMLTypeToGoType(value form.HTMLType) (interface{}, error)

Jump to

Keyboard shortcuts

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