MCPcopy Create free account
hub / github.com/DoNewsCode/core / loadValidators

Function loadValidators

config/module.go:217–230  ·  view source on GitHub ↗
(k *KoanfAdapter, exportedConfigs []ExportedConfig)

Source from the content-addressed store, hash-verified

215}
216
217func loadValidators(k *KoanfAdapter, exportedConfigs []ExportedConfig) error {
218 for _, config := range exportedConfigs {
219 if config.Validate == nil {
220 continue
221 }
222 k.validators = append(k.validators, config.Validate)
223 }
224 for _, f := range k.validators {
225 if err := f(k.K.Raw()); err != nil {
226 return fmt.Errorf("invalid config: %w", err)
227 }
228 }
229 return nil
230}
231
232func getHandler(style string) (handler, error) {
233 switch style {

Callers 1

NewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected