(featureRef string)
| 485 | } |
| 486 | |
| 487 | func ParseFeatureReference(featureRef string) (featureViewName, featureName string, e error) { |
| 488 | parsedFeatureName := strings.Split(featureRef, ":") |
| 489 | |
| 490 | if len(parsedFeatureName) == 0 { |
| 491 | e = errors.New("featureReference should be in the format: 'FeatureViewName:FeatureName'") |
| 492 | } else if len(parsedFeatureName) == 1 { |
| 493 | featureName = parsedFeatureName[0] |
| 494 | } else { |
| 495 | featureViewName = parsedFeatureName[0] |
| 496 | featureName = parsedFeatureName[1] |
| 497 | } |
| 498 | |
| 499 | // Handle @version qualifier on feature view name |
| 500 | if atIdx := strings.Index(featureViewName, "@"); atIdx >= 0 { |
| 501 | suffix := featureViewName[atIdx+1:] |
| 502 | if versionTagRegex.MatchString(suffix) { |
| 503 | e = fmt.Errorf("versioned feature refs (@%s) are not supported by the Go feature server", suffix) |
| 504 | return |
| 505 | } |
| 506 | if strings.EqualFold(suffix, "latest") { |
| 507 | featureViewName = featureViewName[:atIdx] |
| 508 | } |
| 509 | } |
| 510 | return |
| 511 | } |
| 512 | |
| 513 | func entityKeysToProtos(joinKeyValues map[string]*prototypes.RepeatedValue) []*prototypes.EntityKey { |
| 514 | keys := make([]string, len(joinKeyValues)) |
no outgoing calls
no test coverage detected