Exemplo n.º 1
0
Arquivo: main.go Projeto: xiam/bridge
func main() {
	srv := bridge.New("tcp", "127.0.0.1:8088")
	srv.AddRoute("/sum", Sum)
	err := srv.Start()
	if err != nil {
		fmt.Errorf("Error: %v\n", err)
	}
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: xiam/bridge
func main() {
	srv := bridge.New("tcp", "127.0.0.1:8088")

	srv.AddRoute("/strings/contains", strings.Contains)

	srv.AddRoute("/strings/split", strings.Split)

	srv.AddRoute("/strings/repeat", strings.Repeat)

	err := srv.Start()

	if err != nil {
		fmt.Errorf("Error: %v\n", err)
	}

}