Exemple #1
0
func main() {
	s := rpc.NewServer()
	log.Printf("Playback API started")
	s.RegisterCodec(json.NewCodec(), "application/json")
	openstack := new(openstack.OpenStack)
	s.RegisterService(openstack, "")
	log.Printf("Register OpenStack service")
	r := mux.NewRouter()
	r.Handle("/v1", s)
	log.Printf("Handle API version 1")
	log.Printf("Listen on port 7001")
	http.ListenAndServe(":7001", r)
}
func main() {
	s := rpc.NewServer()
	log.Printf("API Server started")
	s.RegisterCodec(json.NewCodec(), "application/json")
	provisioning := new(Provisioning)
	s.RegisterService(provisioning, "")
	log.Printf("Register Provisioning service")
	r := mux.NewRouter()
	r.Handle("/v1", s)
	log.Printf("Handle API version 1")
	log.Printf("Listen on port 7000")
	http.ListenAndServe(":7000", r)
}