new model for links

This commit is contained in:
pb
2024-04-11 16:34:43 +02:00
parent 9cd8af282f
commit 8c5e75855e
2 changed files with 73 additions and 0 deletions

26
models/links.go Normal file
View File

@@ -0,0 +1,26 @@
package models
import (
"fmt"
"reflect"
)
type Link struct {
source string
destination string
dcLink bool
}
func NewLink(src interface{}, dst interface{}) (link Link) {
// Check type with reflect and get ID
typeSrc := reflect.TypeOf(src)
typeDst := reflect.TypeOf(dst)
fmt.Println("src is %s\ndst is %s",typeSrc,typeDst)
return
}
func (l *Link) AddLinkToDataCenter(component interface{}) {
// if the component has a DataCenter id attribute then add it (switch on type)
}