rename to protorpc and jsonrpc
This commit is contained in:
parent
80f53ab176
commit
dddcdc34ed
@ -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,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package json
|
package jsonrpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -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 {
|
@ -1,4 +1,4 @@
|
|||||||
package json
|
package jsonrpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -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"
|
@ -1,4 +1,4 @@
|
|||||||
package proto;
|
package protorpc;
|
||||||
|
|
||||||
message Request {
|
message Request {
|
||||||
optional string service_method = 1;
|
optional string service_method = 1;
|
@ -1,4 +1,4 @@
|
|||||||
package proto
|
package protorpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
@ -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 {
|
@ -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,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user