github.com/weaviate/weaviate@v1.24.6/usecases/config/helpers_for_test.go (about) 1 // _ _ 2 // __ _____ __ ___ ___ __ _| |_ ___ 3 // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ 4 // \ V V / __/ (_| |\ V /| | (_| | || __/ 5 // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| 6 // 7 // Copyright © 2016 - 2024 Weaviate B.V. All rights reserved. 8 // 9 // CONTACT: hello@weaviate.io 10 // 11 12 package config 13 14 import "github.com/pkg/errors" 15 16 type fakeModuleProvider struct { 17 valid []string 18 } 19 20 func (f *fakeModuleProvider) ValidateVectorizer(moduleName string) error { 21 for _, valid := range f.valid { 22 if moduleName == valid { 23 return nil 24 } 25 } 26 27 return errors.Errorf("invalid vectorizer %q", moduleName) 28 }