experimental codec branch
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/micro/go-micro/client"
|
||||
"github.com/micro/go-micro/cmd"
|
||||
"github.com/micro/go-micro/codec/pb"
|
||||
c "github.com/micro/go-micro/context"
|
||||
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||
"golang.org/x/net/context"
|
||||
@@ -119,6 +120,12 @@ func stream() {
|
||||
func main() {
|
||||
cmd.Init()
|
||||
|
||||
client.DefaultClient = client.NewClient(
|
||||
client.Codec("application/pb", pb.Codec),
|
||||
client.ContentType("application/pb"),
|
||||
)
|
||||
|
||||
|
||||
fmt.Println("\n--- Call example ---\n")
|
||||
for i := 0; i < 10; i++ {
|
||||
call(i)
|
||||
|
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
log "github.com/golang/glog"
|
||||
"github.com/micro/go-micro/cmd"
|
||||
"github.com/micro/go-micro/codec/bson"
|
||||
"github.com/micro/go-micro/examples/server/handler"
|
||||
"github.com/micro/go-micro/examples/server/subscriber"
|
||||
"github.com/micro/go-micro/server"
|
||||
@@ -12,11 +13,16 @@ func main() {
|
||||
// optionally setup command line usage
|
||||
cmd.Init()
|
||||
|
||||
server.DefaultServer = server.NewServer(
|
||||
server.Codec("application/bson", bson.Codec),
|
||||
)
|
||||
|
||||
// Initialise Server
|
||||
server.Init(
|
||||
server.Name("go.micro.srv.example"),
|
||||
)
|
||||
|
||||
|
||||
// Register Handlers
|
||||
server.Handle(
|
||||
server.NewHandler(
|
||||
|
Reference in New Issue
Block a user