remove using global map for default codecs (#223)
This commit is contained in:
@@ -15,11 +15,6 @@ import (
|
|||||||
"go.unistack.org/micro/v4/tracer"
|
"go.unistack.org/micro/v4/tracer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultCodecs will be used to encode/decode data
|
|
||||||
var DefaultCodecs = map[string]codec.Codec{
|
|
||||||
"application/octet-stream": codec.NewCodec(),
|
|
||||||
}
|
|
||||||
|
|
||||||
type noopClient struct {
|
type noopClient struct {
|
||||||
funcCall FuncCall
|
funcCall FuncCall
|
||||||
funcStream FuncStream
|
funcStream FuncStream
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ func NewOptions(opts ...Option) Options {
|
|||||||
options := Options{
|
options := Options{
|
||||||
Context: context.Background(),
|
Context: context.Background(),
|
||||||
ContentType: DefaultContentType,
|
ContentType: DefaultContentType,
|
||||||
Codecs: DefaultCodecs,
|
Codecs: make(map[string]codec.Codec),
|
||||||
CallOptions: CallOptions{
|
CallOptions: CallOptions{
|
||||||
Context: context.Background(),
|
Context: context.Background(),
|
||||||
Backoff: DefaultBackoff,
|
Backoff: DefaultBackoff,
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.unistack.org/micro/v4/codec"
|
|
||||||
"go.unistack.org/micro/v4/logger"
|
"go.unistack.org/micro/v4/logger"
|
||||||
"go.unistack.org/micro/v4/register"
|
"go.unistack.org/micro/v4/register"
|
||||||
maddr "go.unistack.org/micro/v4/util/addr"
|
maddr "go.unistack.org/micro/v4/util/addr"
|
||||||
@@ -14,11 +13,6 @@ import (
|
|||||||
"go.unistack.org/micro/v4/util/rand"
|
"go.unistack.org/micro/v4/util/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultCodecs will be used to encode/decode
|
|
||||||
var DefaultCodecs = map[string]codec.Codec{
|
|
||||||
"application/octet-stream": codec.NewCodec(),
|
|
||||||
}
|
|
||||||
|
|
||||||
type rpcHandler struct {
|
type rpcHandler struct {
|
||||||
opts HandlerOptions
|
opts HandlerOptions
|
||||||
handler interface{}
|
handler interface{}
|
||||||
|
|||||||
Reference in New Issue
Block a user