Documentation ¶
Overview ¶
Package validators contains a validator service for caching loaded validators, and it contains language and project specific validators. The validation design and interfaces can be found in package validation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ValidatorService ¶
type ValidatorService struct {
Validators map[string]*validation.Validator
}
ValidatorService is a container for maintaining 'cached' mappers and their symbol sets. Please note that currently, ValidatorService need to be used as mutex, see lexserver/validation.go
func (ValidatorService) HasValidator ¶
func (vs ValidatorService) HasValidator(symbolSetName string) bool
HasValidator is used to check whether a validator exists for the given symbol set
func (ValidatorService) Load ¶
func (vs ValidatorService) Load(symbolsets map[string]symbolset.SymbolSet) error
Load is used to load validators for the input symbol sets
func (ValidatorService) ValidatorForName ¶
func (vs ValidatorService) ValidatorForName(symbolSetName string) (*validation.Validator, error)
ValidatorForName returns the validator with the specified symbol set name. If it's not loaded yet, an error is returned.