(pbEnv *configpb.Environment)
| 322 | } |
| 323 | |
| 324 | func envToValidators(pbEnv *configpb.Environment) ([]*env.Validator, error) { |
| 325 | validators := make([]*env.Validator, 0, len(pbEnv.GetValidators())) |
| 326 | for _, pbValidator := range pbEnv.GetValidators() { |
| 327 | validator := env.NewValidator(pbValidator.GetName()) |
| 328 | config := map[string]any{} |
| 329 | for k, v := range pbValidator.GetConfig() { |
| 330 | val := types.DefaultTypeAdapter.NativeToValue(v) |
| 331 | config[k] = val.Value() |
| 332 | } |
| 333 | validator.SetConfig(config) |
| 334 | validators = append(validators, validator) |
| 335 | } |
| 336 | return validators, nil |
| 337 | } |
| 338 | |
| 339 | func protoDeclToFunctionsAndVariables(declarations []*celpb.Decl) ([]*env.Function, []*env.Variable, error) { |
| 340 | functions := make([]*env.Function, 0, len(declarations)) |
no test coverage detected