示例#1
0
func main() {
	// optionally setup command line usage
	cmd.Init()

	server.Name = "go.micro.service.template"

	// Initialise Server
	server.Init()

	// Register Handlers
	server.Register(
		server.NewReceiver(
			new(handler.Example),
		),
	)

	// Run server
	if err := server.Run(); err != nil {
		log.Fatal(err)
	}
}
示例#2
0
文件: main.go 项目: carriercomm/micro
func main() {
	// optionally setup command line usage
	cmd.Init()

	server.Name = "sample.math"

	// Initialise Server
	server.Init()

	// Register Handlers
	server.Register(
		server.NewReceiver(
			new(handler.Math),
		),
	)

	// Run server
	if err := server.Run(); err != nil {
		log.Fatal(err)
	}
}