sanitizer

package
v0.0.0-...-896db50 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStruct

func DefaultStruct(o interface{})

DefaultStruct will set all defaults value to fields that have a default set this function is to call before filling the struct with form values

Types

type FieldError

type FieldError struct {
	FieldPath   string `json:"field_path"`
	FieldName   string `json:"field_name"`
	ErrorString string `json:"error_string"`
}

func SanitizeStruct

func SanitizeStruct(o interface{}, path_prefix string) []FieldError

SanitizeStruct will sanitize all fields of a struct (o must be a pointer to this struct) return an array of string, one string per error

type Tag

type Tag struct {
	Name     string
	Value    string
	TagError *Tag
}

Jump to

Keyboard shortcuts

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