handler

package
v0.0.0-...-fe1d935 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemsPerPage = 10
	PagesPerSide = 3
)

BasicPaginationExample

Variables

View Source
var StringValidations = map[string]func(data string) string{
	"notempty": func(data string) string {
		data = strings.TrimSpace(data)
		if data == "" {
			return "must not be empty"
		}
		return ""
	},
	"email": func(data string) string {
		data = strings.TrimSpace(data)
		if !emailRegexp.Match([]byte(data)) {
			return "must be valid"
		}
		return ""
	},
	"hasupper": func(data string) string {
		for _, r := range data {
			if unicode.IsUpper(r) {
				return ""
			}
		}
		return "must contain a uppercase letter"
	},
	"haslower": func(data string) string {
		for _, r := range data {
			if unicode.IsLower(r) {
				return ""
			}
		}
		return "must contain a lowercase letter"
	},
	"hasdigit": func(data string) string {
		for _, r := range data {
			if unicode.IsNumber(r) {
				return ""
			}
		}
		return "must contain a number"
	},
	"hasspecial": func(data string) string {
		chars := `§!"@#£¤$%&/{([=?+\'*<>,;.:-_])}`
		if strings.ContainsAny(data, chars) {
			return ""
		}
		return fmt.Sprintf("must contain one of %s", chars)
	},
}

Functions

func DeleteModalExample

func DeleteModalExample(c echo.Context) error

ModalConfirmDelete endpoint to log deleted 'element' and return an empty string to replace the element, i.e. remove it from the DOM

func ErrorHandler

func ErrorHandler(err error, c echo.Context)

func GetAboutPage

func GetAboutPage(c echo.Context) error

func GetActiveSearchExample

func GetActiveSearchExample(c echo.Context) error

ActiveSearchExampleTable

func GetCascadingSelectExample

func GetCascadingSelectExample(c echo.Context) error

func GetComponentAnchors

func GetComponentAnchors(c echo.Context) error

func GetComponentPage

func GetComponentPage(c echo.Context) error

func GetComponentSearch

func GetComponentSearch(c echo.Context) error

func GetDatePicker

func GetDatePicker(c echo.Context) error

BasicDatePicker

func GetDatePickerMonthPicker

func GetDatePickerMonthPicker(c echo.Context) error

func GetDatePickerYearPicker

func GetDatePickerYearPicker(c echo.Context) error

func GetGettingStartedPage

func GetGettingStartedPage(c echo.Context) error

func GetIndexPage

func GetIndexPage(c echo.Context) error

func GetInfiniteScrollExample

func GetInfiniteScrollExample(c echo.Context) error

InfiniteScrollTableExample

func GetInfiniteScrollExampleRows

func GetInfiniteScrollExampleRows(c echo.Context) error

func GetLazyLoadExample

func GetLazyLoadExample(c echo.Context) error

LazyLoadExample

func GetPaginationExamplePage

func GetPaginationExamplePage(c echo.Context) error

func GetPricingExample

func GetPricingExample(c echo.Context) error

PricingExample

func GetPrivacyPolicyPage

func GetPrivacyPolicyPage(c echo.Context) error

func GetTermsOfServicePage

func GetTermsOfServicePage(c echo.Context) error

func GetTypesPage

func GetTypesPage(c echo.Context) error

func NotFound

func NotFound(c echo.Context) error

func PostCombobox

func PostCombobox(c echo.Context) error

BasicCombobox

func PostComboboxSubmit

func PostComboboxSubmit(c echo.Context) error

func PostDatePickerSelectDay

func PostDatePickerSelectDay(c echo.Context) error

func PostValidateString

func PostValidateString(c echo.Context) error

Types

type ErrorToast

type ErrorToast struct {
	Status   int
	Messages []string
}

func (ErrorToast) Error

func (te ErrorToast) Error() string

Jump to

Keyboard shortcuts

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