forms

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Forms

Forms helper library

GoDoc GitHub stars Go Report Card codecov

Versions

Stable Version GitHub Release GitHub Release

Instalation

go get -u github.com/gouef/forms

Usages


Commit rules

Commit message should looks like

[TYPE] some message
Types
  • Add
  • Fix
  • Update
  • Remove
  • Refactor
  • Docs
  • Test
  • Improve

Contributors

JanGalek actions-user

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseInput

type BaseInput interface {
	GetName() string
	GetLabel() *string

	GetHtmlElement() *html.Html
	GetLabelElement() *html.Html
	// contains filtered or unexported methods
}

type Container

type Container interface {
	Render() string
	GetForm() html.Html
	AddText(name string, label *string)
	AddPassword(name string, label *string)
	AddTextArea(name string, label *string)
	AddEmail(name string, label *string)
	AddInteger(name string, label *string)
	AddFloat(name string, label *string)
	AddDate(name string, label *string)
	AddTime(name string, label *string, inSeconds *bool)
	AddDateTime(name string, label *string, inSeconds *bool)
	AddUpload(name string, label *string)
	AddMultiUpload(name string, label *string)
	AddHidden(name string, defaultValue *string)
	AddCheckbox(name string, caption *string)
	AddRadioList(name string, label *string, items []string)
	AddCheckboxList(name string, label *string, items []string)
	AddSelect(name string, label *string, items []string)
	AddMultiSelect(name string, label *string, items []string)
	AddColor(name string, label *string)
	AddSubmit(name string, caption *string)
	AddButton(name string, caption *string)
	AddImageButton(name string, src *string, alt *string)
}

type Form

type Form struct {
	// contains filtered or unexported fields
}

func NewForm

func NewForm() *Form

func (*Form) AddSelect

func (f *Form) AddSelect()

func (*Form) GetRenderer

func (f *Form) GetRenderer() Renderer

func (*Form) SetRenderer

func (f *Form) SetRenderer(renderer Renderer) *Form

type FormElement

type FormElement interface {
	GetHtmlElement() *html.Html
}

type Renderer

type Renderer interface {
	Render() template.HTML
}

func NewSimpleRenderer

func NewSimpleRenderer() Renderer

type RuleValidator

type RuleValidator struct {
}

type SimpleRenderer

type SimpleRenderer struct {
}

func (*SimpleRenderer) Render

func (r *SimpleRenderer) Render() template.HTML

type TextInput

type TextInput struct {
	// contains filtered or unexported fields
}

func NewTextInput

func NewTextInput(name string, label *string) *TextInput

func (*TextInput) GetHtmlElement

func (t *TextInput) GetHtmlElement() *html.Html

func (*TextInput) GetLabel

func (t *TextInput) GetLabel() *string

func (*TextInput) GetLabelElement

func (t *TextInput) GetLabelElement() *html.Html

func (*TextInput) GetName

func (t *TextInput) GetName() string

type Validator

type Validator interface {
	Validate() (bool, []interface{})
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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