types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOWN     = "down"
	TAB      = "tab"
	SHIFTTAB = "shift+tab"
	ENTER    = "enter"
	UP       = "up"
	CTRLR    = "ctrl+r"
	CTRLC    = "ctrl+c"
	ESC      = "esc"
	PASSWORD = "password"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Title  string
	Fields FormFields
}

func (Config) GetFields

func (c Config) GetFields() FormFields

func (Config) GetTitle

func (c Config) GetTitle() string

type CustomField

type CustomField struct {
	InputField
	Lbl  string
	DVal string
	Grp  string
	Lay  LayoutOptions
	Sty  Styles
}

func (CustomField) DefaultValue

func (f CustomField) DefaultValue() string

func (CustomField) Group

func (f CustomField) Group() string

func (CustomField) Label

func (f CustomField) Label() string

func (CustomField) LayoutOptions

func (f CustomField) LayoutOptions() LayoutOptions

func (CustomField) Styles

func (f CustomField) Styles() Styles

type CustomizableField

type CustomizableField interface {
	FormField
	Label() string
	DefaultValue() string
	Group() string
	LayoutOptions() LayoutOptions
	Styles() Styles
}

type DataExporter

type DataExporter struct{}

func (DataExporter) ExportToCSV

func (e DataExporter) ExportToCSV(filename string) error

func (DataExporter) ExportToExcel

func (e DataExporter) ExportToExcel(filename string) error

func (DataExporter) ExportToJSON

func (e DataExporter) ExportToJSON(filename string) error

func (DataExporter) ExportToMarkdown

func (e DataExporter) ExportToMarkdown(filename string) error

func (DataExporter) ExportToPDF

func (e DataExporter) ExportToPDF(filename string) error

func (DataExporter) ExportToXML

func (e DataExporter) ExportToXML(filename string) error

func (DataExporter) ExportToYAML

func (e DataExporter) ExportToYAML(filename string) error

type Exporter

type Exporter interface {
	ExportToCSV(filename string) error
	ExportToYAML(filename string) error
	ExportToJSON(filename string) error
	ExportToXML(filename string) error
	ExportToExcel(filename string) error
	ExportToPDF(filename string) error
	ExportToMarkdown(filename string) error
}

type Field

type Field interface {
	Type() string
	Value() string
	Placeholder() string
	ValidationRules() []ValidationRule
}

type FormConfig

type FormConfig struct {
	Title  string
	Fields []Field
}

type FormField

type FormField interface {
	Placeholder() string
	Type() string
	Value() string
	Required() bool
	MinLength() int
	MaxLength() int
	ErrorMessage() string
	Validator() func(string) error
}

type FormFields

type FormFields struct {
	Title  string
	Fields []FormField
}

Collection of form fields

func (FormFields) InputType

func (f FormFields) InputType() string

func (FormFields) Inputs

func (f FormFields) Inputs() []FormField

type InputField

type InputField struct {
	Ph  string
	Tp  string
	Val string
	Req bool
	Min int
	Max int
	Err string
	Vld func(string) error
}

func (InputField) ErrorMessage

func (f InputField) ErrorMessage() string

func (InputField) MaxLength

func (f InputField) MaxLength() int

func (InputField) MinLength

func (f InputField) MinLength() int

func (InputField) Placeholder

func (f InputField) Placeholder() string

func (InputField) Required

func (f InputField) Required() bool

func (InputField) Type

func (f InputField) Type() string

func (InputField) ValidationRules

func (f InputField) ValidationRules() []ValidationRule

func (InputField) Validator

func (f InputField) Validator() func(string) error

func (InputField) Value

func (f InputField) Value() string

type LayoutOptions

type LayoutOptions struct {
	Horizontal bool
	Vertical   bool
}

type Styles

type Styles struct {
	FieldStyle    string
	LabelStyle    string
	ErrorStyle    string
	TemplateStyle string
}

type TableDataHandler

type TableDataHandler interface {
	GetHeaders() []string
	GetRows() [][]string
}

type ValidationRule

type ValidationRule interface {
	Validate(value string) error
}

Jump to

Keyboard shortcuts

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