Documentation ¶
Index ¶
- type Cache
- type MessageCode
- type ModelID
- type ModelType
- type ModelTypeInfo
- type ModelValidator
- type SysType
- type ValidationResult
- type ValidationResultMessage
- type ValidationResults
- type Validator
- func (v *Validator) Get(modelType ModelType, modelID ModelID) (*ValidationResult, *errors.ValidationError)
- func (v *Validator) List(modelType ModelType) (map[ModelID]*ValidationResult, error)
- func (v *Validator) ListModelTypes() []ModelType
- func (v *Validator) MapListToCSV(modelType ModelType) (string, error)
- func (v *Validator) Update(ctx context.Context)
- func (v *Validator) Validate(ctx context.Context, modelType ModelType, modelID ModelID) (*ValidationResult, *errors.ValidationError)
- func (v *Validator) ValidateAll(ctx context.Context) error
- type ValidatorProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
func (*Cache) Get ¶
func (c *Cache) Get(modelType ModelType, modelID ModelID) (*ValidationResult, bool)
func (*Cache) GetForType ¶
func (c *Cache) GetForType(modelType ModelType) map[ModelID]*ValidationResult
func (*Cache) GetPool ¶
func (c *Cache) GetPool() ValidationResults
func (*Cache) SetForType ¶
func (c *Cache) SetForType(modelType ModelType, results map[ModelID]*ValidationResult)
type MessageCode ¶
type MessageCode string
type ModelTypeInfo ¶
type ModelValidator ¶
type ModelValidator interface { Validate(ctx context.Context, modelID ModelID) (*ValidationResult, *errors.ValidationError) ValidateAll(ctx context.Context) (map[ModelID]*ValidationResult, error) }
type ValidationResult ¶
type ValidationResult struct { ID ModelID `json:"id"` Title string `json:"title,omitempty"` InternalTitle string `json:"internalTitle,omitempty"` LastUpdatedDate string `json:"lastUpdatedDate,omitempty"` ModelType ModelType `json:"modelType"` Health constants.Health `json:"health"` Messages []*ValidationResultMessage `json:"messages"` }
func (*ValidationResult) Log ¶
func (result *ValidationResult) Log(severity constants.Severity, message string, code MessageCode)
func (*ValidationResult) UpdateHealth ¶
func (result *ValidationResult) UpdateHealth()
type ValidationResultMessage ¶
type ValidationResultMessage struct { Code MessageCode `json:"code"` Message string `json:"message"` Severity constants.Severity `json:"severity"` }
type ValidationResults ¶
type ValidationResults map[ModelType]map[ModelID]*ValidationResult
type Validator ¶
type Validator struct { Validators map[ModelType]ModelValidator Cache *Cache // contains filtered or unexported fields }
func NewValidator ¶
func (*Validator) Get ¶
func (v *Validator) Get(modelType ModelType, modelID ModelID) ( *ValidationResult, *errors.ValidationError, )
func (*Validator) List ¶
func (v *Validator) List(modelType ModelType) ( map[ModelID]*ValidationResult, error, )
func (*Validator) ListModelTypes ¶
func (*Validator) MapListToCSV ¶
func (*Validator) Validate ¶
func (v *Validator) Validate(ctx context.Context, modelType ModelType, modelID ModelID) ( *ValidationResult, *errors.ValidationError, )
type ValidatorProvider ¶
type ValidatorProvider interface {
GetValidators() map[ModelType]ModelValidator
}
Click to show internal directories.
Click to hide internal directories.