Documentation ¶
Overview ¶
Package validation provides simple validation of goldi containers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
A Constraint represents a certain criteria that a container needs to fulfill in order to be valid.
type ContainerValidator ¶
type ContainerValidator struct {
Constraints []Constraint
}
The ContainerValidator can be used to determine whether a container passes a set of validation constraints.
func NewContainerValidator ¶
func NewContainerValidator() *ContainerValidator
NewContainerValidator creates a new ContainerValidator. The validator will be initialized with the NoInvalidTypesConstraint, TypeParametersConstraint and TypeReferencesConstraint
func (*ContainerValidator) Add ¶
func (v *ContainerValidator) Add(constraint Constraint)
Add another constraint to this validator
func (*ContainerValidator) MustValidate ¶
func (v *ContainerValidator) MustValidate(container *goldi.Container)
MustValidate behaves exactly as ContainerValidator.Validate but panics if an error occurs
type NoInvalidTypesConstraint ¶
type NoInvalidTypesConstraint struct{}
The NoInvalidTypesConstraint checks all types that none of the registered types is invalid
type TypeParametersConstraint ¶
type TypeParametersConstraint struct{}
The TypeParametersConstraint is used in a ContainerValidator to check if all used parameters do exist.
type TypeReferencesConstraint ¶
type TypeReferencesConstraint struct {
// contains filtered or unexported fields
}
The TypeReferencesConstraint is used in a ContainerValidator to check if all referenced types in the container have been defined.