check

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateChoice

func ValidateChoice(obj gjson.Result, answers []any, qt part.QuestionType) error

ValidateChoice validates the answers for the given choice type. obj: the JSON representation of the survey. answers: the list of answers to validate. qt: the type of the choice field.

func ValidateText

func ValidateText(obj gjson.Result, answers []any, qt part.QuestionType) error

ValidateText validates format of the answers for the given text type.

Types

type QuestionChecker added in v1.1.0

type QuestionChecker func(obj gjson.Result, answers []any, qt part.QuestionType) error

QuestionChecker is an alias for a function that validates the answers for a question.

func GetQuestionChecker added in v1.1.0

func GetQuestionChecker(qt part.QuestionType) (QuestionChecker, error)

GetQuestionChecker returns the QuestionChecker for the given question type.

Jump to

Keyboard shortcuts

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