rts-sim-module/examples/basic/main.go

28 lines
529 B
Go

package main
import (
"fmt"
"time"
"joylink.club/rtsssimulation/repository"
"joylink.club/rtsssimulation/repository/model/proto"
)
var Repo *repository.Repository
func main() {
link := repository.NewLink("1")
fmt.Println(link)
lp := repository.NewLinkPort(link, proto.Port_A)
fmt.Println(lp)
Repo = repository.NewRepository("1" /* id */, "0.1" /* version */)
section := repository.NewPhysicalSection("s1")
fmt.Println(section)
Repo.AddPhysicalSection(section)
fmt.Println(Repo)
time.Sleep(5 * time.Second)
}