experimental codec branch

This commit is contained in:
Asim
2015-11-27 00:17:36 +00:00
parent dc5f121c64
commit f49922f6b3
10 changed files with 183 additions and 57 deletions

View File

@@ -2,14 +2,15 @@ package client
import (
"github.com/micro/go-micro/broker"
"github.com/micro/go-micro/codec"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/transport"
)
type options struct {
contentType string
codecs map[string]CodecFunc
broker broker.Broker
codecs map[string]codec.Codec
registry registry.Registry
transport transport.Transport
wrappers []Wrapper
@@ -23,9 +24,9 @@ func Broker(b broker.Broker) Option {
}
// Codec to be used to encode/decode requests for a given content type
func Codec(contentType string, cf CodecFunc) Option {
func Codec(contentType string, c codec.Codec) Option {
return func(o *options) {
o.codecs[contentType] = cf
o.codecs[contentType] = c
}
}