Create a gist now

Instantly share code, notes, and snippets.

@laser /server.go
Last active Aug 29, 2015

What would you like to do?
Basic Server - Golang
package main
import (
"fmt"
"github.com/coopernurse/barrister-go"
"todo_manager"
)
func NewTodoManagerProxy(url string) todo_manager.TodoManager {
trans := &barrister.HttpTransport{Url: url}
client := barrister.NewRemoteClient(trans, true)
return todo_manager.NewTodoManagerProxy(client)
}
func main() {
proxy := NewTodoManagerProxy("http://localhost:3000/v1/todos")
props := todo_manager.TodoProperties{"Call Dad", false}
res, err := proxy.CreateTodo(props)
if err == nil {
fmt.Println(res)
} else {
fmt.Println("ERROR! ", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment