Skip to content

Commit

Permalink
Merge pull request #501 from MUzairS15/MUzairS15/relationship-query
Browse files Browse the repository at this point in the history
[Relationship] Add method to retrieve default `evaluation_query` for a relationship
  • Loading branch information
Mohd Uzair authored Jun 3, 2024
2 parents bd00372 + e65ac1e commit 91538ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions models/meshmodel/core/v1alpha2/relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v1alpha2
import (
"fmt"
"path/filepath"
"strings"

"github.com/google/uuid"
"github.com/layer5io/meshkit/database"
Expand Down Expand Up @@ -67,3 +68,7 @@ func (c RelationshipDefinition) WriteComponentDefinition(relDirPath string) erro
err := utils.WriteJSONToFile[RelationshipDefinition](relPath, c)
return err
}

func (r *RelationshipDefinition) GetDefaultEvaluationQuery() string {
return fmt.Sprintf("%s_%s_relationship", strings.ToLower(r.Kind), strings.ToLower(r.SubType))
}

0 comments on commit 91538ac

Please sign in to comment.