rename to protorpc and jsonrpc

This commit is contained in:
Asim 2015-11-28 18:54:38 +00:00
parent 80f53ab176
commit dddcdc34ed
9 changed files with 23 additions and 23 deletions

View File

@ -4,8 +4,8 @@ import (
"bytes" "bytes"
"github.com/micro/go-micro/codec" "github.com/micro/go-micro/codec"
"github.com/micro/go-micro/codec/json" "github.com/micro/go-micro/codec/jsonrpc"
"github.com/micro/go-micro/codec/proto" "github.com/micro/go-micro/codec/protorpc"
"github.com/micro/go-micro/transport" "github.com/micro/go-micro/transport"
rpc "github.com/youtube/vitess/go/rpcplus" rpc "github.com/youtube/vitess/go/rpcplus"
) )
@ -27,11 +27,11 @@ var (
defaultContentType = "application/octet-stream" defaultContentType = "application/octet-stream"
defaultCodecs = map[string]codec.NewCodec{ defaultCodecs = map[string]codec.NewCodec{
"application/json": json.NewCodec, "application/json": jsonrpc.NewCodec,
"application/json-rpc": json.NewCodec, "application/json-rpc": jsonrpc.NewCodec,
"application/protobuf": proto.NewCodec, "application/protobuf": protorpc.NewCodec,
"application/proto-rpc": proto.NewCodec, "application/proto-rpc": protorpc.NewCodec,
"application/octet-stream": proto.NewCodec, "application/octet-stream": protorpc.NewCodec,
} }
) )

View File

@ -1,4 +1,4 @@
package json package jsonrpc
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package json package jsonrpc
import ( import (
"bytes" "bytes"
@ -23,7 +23,7 @@ func (j *jsonCodec) Close() error {
} }
func (j *jsonCodec) String() string { func (j *jsonCodec) String() string {
return "json" return "json-rpc"
} }
func (j *jsonCodec) Write(m *codec.Message, b interface{}) error { func (j *jsonCodec) Write(m *codec.Message, b interface{}) error {

View File

@ -1,4 +1,4 @@
package json package jsonrpc
import ( import (
"encoding/json" "encoding/json"

View File

@ -12,7 +12,7 @@ It has these top-level messages:
Request Request
Response Response
*/ */
package proto package protorpc
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import json "encoding/json" import json "encoding/json"

View File

@ -1,4 +1,4 @@
package proto; package protorpc;
message Request { message Request {
optional string service_method = 1; optional string service_method = 1;

View File

@ -1,4 +1,4 @@
package proto package protorpc
import ( import (
"encoding/binary" "encoding/binary"

View File

@ -1,4 +1,4 @@
package proto package protorpc
import ( import (
"bytes" "bytes"
@ -27,7 +27,7 @@ func (c *protoCodec) Close() error {
} }
func (c *protoCodec) String() string { func (c *protoCodec) String() string {
return "proto" return "proto-rpc"
} }
func (c *protoCodec) Write(m *codec.Message, b interface{}) error { func (c *protoCodec) Write(m *codec.Message, b interface{}) error {

View File

@ -4,8 +4,8 @@ import (
"bytes" "bytes"
"github.com/micro/go-micro/codec" "github.com/micro/go-micro/codec"
"github.com/micro/go-micro/codec/json" "github.com/micro/go-micro/codec/jsonrpc"
"github.com/micro/go-micro/codec/proto" "github.com/micro/go-micro/codec/protorpc"
"github.com/micro/go-micro/transport" "github.com/micro/go-micro/transport"
rpc "github.com/youtube/vitess/go/rpcplus" rpc "github.com/youtube/vitess/go/rpcplus"
) )
@ -25,11 +25,11 @@ type readWriteCloser struct {
var ( var (
defaultCodecs = map[string]codec.NewCodec{ defaultCodecs = map[string]codec.NewCodec{
"application/json": json.NewCodec, "application/json": jsonrpc.NewCodec,
"application/json-rpc": json.NewCodec, "application/json-rpc": jsonrpc.NewCodec,
"application/protobuf": proto.NewCodec, "application/protobuf": protorpc.NewCodec,
"application/proto-rpc": proto.NewCodec, "application/proto-rpc": protorpc.NewCodec,
"application/octet-stream": proto.NewCodec, "application/octet-stream": protorpc.NewCodec,
} }
) )