27 lines
496 B
Go
27 lines
496 B
Go
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)
|
|
}
|
|
|