You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
515 B
Go
28 lines
515 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"FRMS/internal/pkg/reactor"
|
|
)
|
|
|
|
type coordinator interface {
|
|
Start() error
|
|
}
|
|
|
|
func NewCoordinator(s string,ch chan error) coordinator {
|
|
// allows interface checking as opposed to calling directly
|
|
return reactor.NewCoordinator(s,ch)
|
|
}
|
|
|
|
func main() {
|
|
ch := make(chan error)
|
|
rlc := NewCoordinator("192.1.168.136:2000",ch) // host port
|
|
go rlc.Start()
|
|
fmt.Printf("Starting reactor\n")
|
|
err := <-ch
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|
|
|