Ejemplo n.º 1
0
func main() {

	// Pull in command line options or defaults if none given
	flag.Parse()

	r := NewGetUserDataService()
	skylib.NewAgent().Register(r).Start().Wait()
}
Ejemplo n.º 2
0
func main() {

	// Pull in command line options or defaults if none given
	flag.Parse()

	skylib.NewAgent().Start()

	monitorServices()
}
Ejemplo n.º 3
0
func main() {
	flag.Parse()
	skylib.NewAgent().Start()
	service := "MyRandomService"
	client, _ := skylib.GetRandomClientByService(service)
	request := rand.Intn(10) + 1
	println("Request:", request)
	var response string = "default" // to prove it has changed
	client.Call(service+".RandString", request, &response)
	println("Reponse:", response)
	println("Done.")
}
Ejemplo n.º 4
0
// The Router application registers RPC listeners to accept from the initiators
// then registers RPC clients to each of the external services it may call.
func main() {

	var err os.Error

	// Pull in command line options or defaults if none given
	flag.Parse()

	agent := skylib.NewAgent().Start()

	CreateInitialRoute()

	route, err = skylib.GetRoute(sName)
	if err != nil {
		log.Panic("Unable to retrieve route.")
	}

	r := &RouteService{Name: *skylib.Name}
	agent.Register(r).Wait()
}
Ejemplo n.º 5
0
func main() {
	// Pull in command line options or defaults if none given
	flag.Parse()

	skylib.NewAgent().Start()

	homeTmpl = template.MustParse(homeTemplate, nil)
	respTmpl = template.MustParse(responseTemplate, nil)

	portString := fmt.Sprintf("%s:%d", *skylib.BindIP, *skylib.Port)

	stack := new(mango.Stack)
	stack.Address = portString

	routes := make(map[string]mango.App)
	routes["/"] = homeHandler
	routes["/new"] = submitHandler
	stack.Middleware(mango.Routing(routes))
	stack.Run(nil)
}
Ejemplo n.º 6
0
func main() {

	var err os.Error

	// Pull in command line options or defaults if none given
	flag.Parse()

	skylib.NewAgent().Start()

	homeTmpl = template.MustParse(homeTemplate, nil)
	respTmpl = template.MustParse(responseTemplate, nil)

	http.HandleFunc("/", homeHandler)
	http.HandleFunc("/new", submitHandler)

	portString := fmt.Sprintf("%s:%d", *skylib.BindIP, *skylib.Port)

	err = http.ListenAndServe(portString, nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err.String())
	}
}
Ejemplo n.º 7
0
func main() {
	flag.Parse()
	sig := &MyRandomService{}
	skylib.NewAgent().Register(sig).Start().Wait()
}