rename to protorpc and jsonrpc
This commit is contained in:
parent
80f53ab176
commit
dddcdc34ed
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
|
||||
"github.com/micro/go-micro/codec"
|
||||
"github.com/micro/go-micro/codec/json"
|
||||
"github.com/micro/go-micro/codec/proto"
|
||||
"github.com/micro/go-micro/codec/jsonrpc"
|
||||
"github.com/micro/go-micro/codec/protorpc"
|
||||
"github.com/micro/go-micro/transport"
|
||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||
)
|
||||
@ -27,11 +27,11 @@ var (
|
||||
defaultContentType = "application/octet-stream"
|
||||
|
||||
defaultCodecs = map[string]codec.NewCodec{
|
||||
"application/json": json.NewCodec,
|
||||
"application/json-rpc": json.NewCodec,
|
||||
"application/protobuf": proto.NewCodec,
|
||||
"application/proto-rpc": proto.NewCodec,
|
||||
"application/octet-stream": proto.NewCodec,
|
||||
"application/json": jsonrpc.NewCodec,
|
||||
"application/json-rpc": jsonrpc.NewCodec,
|
||||
"application/protobuf": protorpc.NewCodec,
|
||||
"application/proto-rpc": protorpc.NewCodec,
|
||||
"application/octet-stream": protorpc.NewCodec,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package json
|
||||
package jsonrpc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@ -1,4 +1,4 @@
|
||||
package json
|
||||
package jsonrpc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@ -23,7 +23,7 @@ func (j *jsonCodec) Close() error {
|
||||
}
|
||||
|
||||
func (j *jsonCodec) String() string {
|
||||
return "json"
|
||||
return "json-rpc"
|
||||
}
|
||||
|
||||
func (j *jsonCodec) Write(m *codec.Message, b interface{}) error {
|
@ -1,4 +1,4 @@
|
||||
package json
|
||||
package jsonrpc
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@ -12,7 +12,7 @@ It has these top-level messages:
|
||||
Request
|
||||
Response
|
||||
*/
|
||||
package proto
|
||||
package protorpc
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import json "encoding/json"
|
@ -1,4 +1,4 @@
|
||||
package proto;
|
||||
package protorpc;
|
||||
|
||||
message Request {
|
||||
optional string service_method = 1;
|
@ -1,4 +1,4 @@
|
||||
package proto
|
||||
package protorpc
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
@ -1,4 +1,4 @@
|
||||
package proto
|
||||
package protorpc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@ -27,7 +27,7 @@ func (c *protoCodec) Close() error {
|
||||
}
|
||||
|
||||
func (c *protoCodec) String() string {
|
||||
return "proto"
|
||||
return "proto-rpc"
|
||||
}
|
||||
|
||||
func (c *protoCodec) Write(m *codec.Message, b interface{}) error {
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
|
||||
"github.com/micro/go-micro/codec"
|
||||
"github.com/micro/go-micro/codec/json"
|
||||
"github.com/micro/go-micro/codec/proto"
|
||||
"github.com/micro/go-micro/codec/jsonrpc"
|
||||
"github.com/micro/go-micro/codec/protorpc"
|
||||
"github.com/micro/go-micro/transport"
|
||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||
)
|
||||
@ -25,11 +25,11 @@ type readWriteCloser struct {
|
||||
|
||||
var (
|
||||
defaultCodecs = map[string]codec.NewCodec{
|
||||
"application/json": json.NewCodec,
|
||||
"application/json-rpc": json.NewCodec,
|
||||
"application/protobuf": proto.NewCodec,
|
||||
"application/proto-rpc": proto.NewCodec,
|
||||
"application/octet-stream": proto.NewCodec,
|
||||
"application/json": jsonrpc.NewCodec,
|
||||
"application/json-rpc": jsonrpc.NewCodec,
|
||||
"application/protobuf": protorpc.NewCodec,
|
||||
"application/proto-rpc": protorpc.NewCodec,
|
||||
"application/octet-stream": protorpc.NewCodec,
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user