Skip to content

Commit

Permalink
make model entity interface compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Singh <pranavsingh02@hotmail.com>
  • Loading branch information
theBeginner86 committed Sep 28, 2023
1 parent 4577fd6 commit a85f6ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions models/meshmodel/core/v1alpha1/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/google/uuid"
"github.com/layer5io/meshkit/database"
"github.com/layer5io/meshkit/models/meshmodel/core/types"
"gorm.io/gorm"
)

Expand Down Expand Up @@ -53,6 +54,14 @@ type ModelDB struct {
Metadata []byte `json:"modelMetadata" gorm:"modelMetadata"`
}

func (m Model) Type() types.CapabilityType {
return types.Model
}
func (m Model) GetID() uuid.UUID {
return m.ID
}


func CreateModel(db *database.Handler, cmodel Model) (uuid.UUID, error) {
byt, err := json.Marshal(cmodel)
if err != nil {
Expand Down

0 comments on commit a85f6ae

Please sign in to comment.