form

package
v0.0.0-...-6f8c8e2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RatingFormStructure defines the rating form
	RatingFormStructure = []RatingFormField{
		{
			Type:     "input",
			ID:       "name",
			Name:     "name",
			Label:    "User name",
			Value:    "",
			Icon:     "user",
			HasError: false,
			Errors:   nil,
		},
		{
			Type:     "stars",
			ID:       "stars",
			Name:     "stars",
			Label:    "Stars",
			Value:    "",
			Icon:     "",
			HasError: false,
			Errors:   nil,
		},
		{
			Type:     "input",
			ID:       "title",
			Name:     "title",
			Label:    "Title",
			Value:    "",
			Icon:     "header",
			HasError: false,
			Errors:   nil,
		},
		{
			Type:     "textarea",
			ID:       "text",
			Name:     "text",
			Label:    "Text",
			Value:    "",
			Icon:     "edit",
			HasError: false,
			Errors:   nil,
		},
	}
)

Functions

This section is empty.

Types

type RatingFormData

type RatingFormData struct {
	ProductID string `form:"product_id" validate:"required" conform:"num"`
	Name      string `form:"name" validate:"required" conform:"name"`
	Stars     string `form:"stars" validate:"required" conform:"num"`
	Title     string `form:"title" validate:"required" conform:"trim"`
	Text      string `form:"text" validate:"required" conform:"trim"`
}

RatingFormData represents the data of the rating form

type RatingFormDataProvider

type RatingFormDataProvider struct{}

RatingFormDataProvider is the flamingo form service implementation for the rating form

func (*RatingFormDataProvider) GetFormData

func (p *RatingFormDataProvider) GetFormData(context.Context, *web.Request) (interface{}, error)

GetFormData returns the default form values

type RatingFormField

type RatingFormField struct {
	Type        string
	ID          string
	Name        string
	Label       string
	Value       string
	Icon        string
	HasFeedback bool
	HasError    bool
	Errors      []string
}

RatingFormField represents a Field of the rating form

Jump to

Keyboard shortcuts

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