input

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const MINIMAL_DEFAULT_PASSWORD = 2
View Source
const PatternMonthDay = `^[0-9]{2,2}$`

Variables

View Source
var HOURS = []string{
	"3 hras", "8 hras", "1 hora", "7 horas", "1 dia", "5 horas",
}
View Source
var PREPOSITIONS = []string{
	"ante", "bajo", "contra", "de", "por", "si", "sobre", "detras",
}
View Source
var WRONG_DATA = []string{
	"-1", "0", " ", "", "#", "& ", "% &", "SELECT * FROM", "=",
}

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	InputId string //id único input

	TagType               string //radio,check,text,number
	CssClass              string // clase css ej: "age"
	PropertieName         string //name="nombre"
	DataSetFieldName      string //"age-date","run","ip"
	ValueIn               string //valor por defecto
	TitleInfo             string //info
	Pattern               string //caracteres para validación
	SkipCompletionAllowed bool   //campo requerido validado
	Minimum               string //valor mínimo
	Maximum               string //valor máximo
	Autocomplete          string //on por defecto
	//textarea
	Rows        string //filas ej 4,5,6
	Cols        string //columnas ej 50,80
	Other       string //otro atributo
	PlaceHolder string
	Step        string
}

func (Attribute) Build

func (a Attribute) Build() string

TagType:radio,text,number etc TagInput <input type="input"

type Date

type Date struct {
}

formato fecha: DD-MM-YYYY

func (Date) Build

func (d Date) Build(id, field_name string, skip_completion_allowed bool) string

func (Date) GoodTestData

func (d Date) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Date) HtmlName

func (d Date) HtmlName() string

func (Date) Name

func (d Date) Name() string

func (Date) Validate

func (d Date) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Date) WrongTestData

func (d Date) WrongTestData() (out []string)

type Hour

type Hour struct {
	Min string //ej 08:00
	Max string //ej 17:00
}

formato 08:00

func (Hour) Build

func (h Hour) Build(id, field_name string, skip_completion_allowed bool) string

func (Hour) GoodTestData

func (h Hour) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Hour) HtmlName

func (h Hour) HtmlName() string

func (Hour) Name

func (h Hour) Name() string

func (Hour) Validate

func (h Hour) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Hour) WrongTestData

func (h Hour) WrongTestData() (out []string)

type Info

type Info struct {
	Value string //valor a mostrar
}

input de caracter informativo

func (Info) Build

func (i Info) Build(id, field_name string, skip_completion_allowed bool) string

func (Info) HtmlName

func (i Info) HtmlName() string

func (Info) Name

func (i Info) Name() string

func (Info) Validate

func (i Info) Validate(data_in string, skip_validation bool) bool

no requerido

type Mail

type Mail struct {
}

func (Mail) Build

func (t Mail) Build(id, field_name string, skip_completion_allowed bool) string

func (Mail) GoodTestData

func (Mail) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Mail) HtmlName

func (Mail) HtmlName() string

func (Mail) Name

func (Mail) Name() string

func (Mail) Validate

func (Mail) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Mail) WrongTestData

func (Mail) WrongTestData() (out []string)

type MonthDay

type MonthDay struct {
	Hidden bool
}

formato fecha: DD-MM

func (MonthDay) Build

func (m MonthDay) Build(id, field_name string, skip_completion_allowed bool) string

func (MonthDay) GoodTestData

func (m MonthDay) GoodTestData(table_name, field_name string, random bool) (out []string)

func (MonthDay) HtmlName

func (d MonthDay) HtmlName() string

func (MonthDay) Name

func (d MonthDay) Name() string

func (MonthDay) Validate

func (m MonthDay) Validate(data_in string, skip_validation bool) (ok bool)

validacion con datos de entrada

func (MonthDay) WrongTestData

func (m MonthDay) WrongTestData() (out []string)

type Number

type Number struct {
	CssClass string // ej money
	Data     string //ej ` data-after=" Años" `
	Hidden   bool
	Pattern  string //ej `^[0-9]{1,17}$`
}

solo valores numéricos positivos >= 0 máximo 20 char 18446744073709551615

func (Number) Build

func (n Number) Build(id, field_name string, skip_completion_allowed bool) string

func (Number) FieldAddEventListener

func (n Number) FieldAddEventListener(field_name string) string

func (Number) FieldRemoveEventListener

func (n Number) FieldRemoveEventListener(field_name string) string

func (Number) GoodTestData

func (n Number) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Number) HtmlName

func (n Number) HtmlName() string

func (Number) Name

func (n Number) Name() string

func (Number) Validate

func (n Number) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Number) WrongTestData

func (n Number) WrongTestData() (out []string)

type Password

type Password struct {
	Atribute string
	Minimal  int8 //mínimo de caracteres permitidos ej: 5 o 20
}

[a-zA-Z][a-zA-Z0-9-_.]{5,15}

Solo letras (en cualquier caso), números, guiones, guiones bajos y puntos.
(No el carácter de barra, que se usa para escapar del punto).

debe comenzar con una letra y debe tener entre 5 y 10 caracteres (inclusive).

func (Password) Build

func (p Password) Build(id, field_name string, skip_completion_allowed bool) string

func (Password) GoodTestData

func (p Password) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Password) HtmlName

func (p Password) HtmlName() string

func (Password) Name

func (p Password) Name() string

func (Password) Validate

func (p Password) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Password) WrongTestData

func (p Password) WrongTestData() (out []string)

type Pk

type Pk struct {
	Hidden                   bool
	RemoveLabelRequiredInTag bool
}

Primary key

func (Pk) Build

func (p Pk) Build(id, field_name string, skip_completion_allowed bool) string

representación

func (Pk) GoodTestData

func (p Pk) GoodTestData(table_name, field_name string, random bool) (out []string)

func (Pk) HtmlName

func (p Pk) HtmlName() string

func (Pk) Name

func (p Pk) Name() string

func (Pk) Validate

func (p Pk) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Pk) WrongTestData

func (p Pk) WrongTestData() (out []string)

type Text

type Text struct {
	Hidden bool
	// contains filtered or unexported fields
}

texto,punto,coma, paréntesis o números permitidos

func (Text) Build

func (t Text) Build(id, field_name string, skip_completion_allowed bool) string

func (Text) GoodTestData

func (t Text) GoodTestData(table_name, field_name string, random bool) (out []string)

options: first_name,last_name, phrase

func (Text) HtmlName

func (t Text) HtmlName() string

func (Text) Name

func (t Text) Name() string

func (Text) Validate

func (r Text) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (Text) WrongTestData

func (t Text) WrongTestData() (out []string)

type TextNum

type TextNum struct {
}

texto, numero y guion bajo 5 a 15 caracteres

func (TextNum) Build

func (t TextNum) Build(id, field_name string, skip_completion_allowed bool) string

func (TextNum) GoodTestData

func (t TextNum) GoodTestData(table_name, field_name string, random bool) (out []string)

func (TextNum) HtmlName

func (t TextNum) HtmlName() string

func (TextNum) Name

func (t TextNum) Name() string

func (TextNum) Validate

func (r TextNum) Validate(data_in string, skip_validation bool) (ok bool)

validacion con datos de entrada

func (TextNum) WrongTestData

func (t TextNum) WrongTestData() (out []string)

type TextNumCode

type TextNumCode struct {
}

texto y numero para código ej: V234

func (TextNumCode) Build

func (t TextNumCode) Build(id, field_name string, skip_completion_allowed bool) string

func (TextNumCode) GoodTestData

func (t TextNumCode) GoodTestData(table_name, field_name string, random bool) (out []string)

func (TextNumCode) HtmlName

func (t TextNumCode) HtmlName() string

func (TextNumCode) Name

func (t TextNumCode) Name() string

func (TextNumCode) Validate

func (r TextNumCode) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (TextNumCode) WrongTestData

func (t TextNumCode) WrongTestData() (out []string)

type TextOnly

type TextOnly struct {
	Hidden          bool
	PatternTextOnly string //ej: `^[A-Za-zÑñáéíóú ]{3,50}$`
	// contains filtered or unexported fields
}

func (TextOnly) Build

func (t TextOnly) Build(id, field_name string, skip_completion_allowed bool) string

func (TextOnly) GoodTestData

func (t TextOnly) GoodTestData(table_name, field_name string, random bool) (out []string)

func (TextOnly) HtmlName

func (t TextOnly) HtmlName() string

func (TextOnly) Name

func (t TextOnly) Name() string

func (TextOnly) Validate

func (t TextOnly) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (TextOnly) WrongTestData

func (t TextOnly) WrongTestData() (out []string)

type TextSearch

type TextSearch struct {
}

letras numeros - permitidos max 50 caracteres

func (TextSearch) Build

func (t TextSearch) Build(id, field_name string, skip_completion_allowed bool) string

func (TextSearch) GoodTestData

func (s TextSearch) GoodTestData(table_name, field_name string, random bool) (out []string)

func (TextSearch) HtmlName

func (t TextSearch) HtmlName() string

func (TextSearch) Name

func (t TextSearch) Name() string

func (TextSearch) Validate

func (r TextSearch) Validate(data_in string, skip_validation bool) (ok bool)

validación con datos de entrada

func (TextSearch) WrongTestData

func (s TextSearch) WrongTestData() (out []string)

Jump to

Keyboard shortcuts

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