validators

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: GPL-3.0 Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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