(spec *pb.VectorIndexSpec)
| 187 | } |
| 188 | |
| 189 | func GetFactoryCreateSpecFromSpec(spec *pb.VectorIndexSpec) (*FactoryCreateSpec, error) { |
| 190 | factory, found := GetIndexFactoryFromSpec(spec) |
| 191 | if !found { |
| 192 | return &FactoryCreateSpec{}, errors.Errorf( |
| 193 | "cannot find index factory named '%s'", spec.Name) |
| 194 | } |
| 195 | opts, err := getOptsFromFactorySpec(factory, spec) |
| 196 | if err != nil { |
| 197 | return &FactoryCreateSpec{}, err |
| 198 | } |
| 199 | return &FactoryCreateSpec{factory: factory, opts: opts}, nil |
| 200 | } |
| 201 | |
| 202 | func GetIndexFactoryFromSpec(spec *pb.VectorIndexSpec) (IndexFactory, bool) { |
| 203 | return GetIndexFactory(spec.Name) |
no test coverage detected